Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1522bcb

Browse files
authored
Merge pull request #169 from ambitioninc/develop
6.0.0
2 parents f9a4b63 + 5077b83 commit 1522bcb

File tree

9 files changed

+115
-86
lines changed

9 files changed

+115
-86
lines changed

.github/workflows/tests.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# copied from django-cte
2+
name: entity tests
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master,develop]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python: ['3.7', '3.8', '3.9']
16+
# Time to switch to pytest or nose2??
17+
# nosetests is broken on 3.10
18+
# AttributeError: module 'collections' has no attribute 'Callable'
19+
# https://github.com/nose-devs/nose/issues/1099
20+
django:
21+
- 'Django~=2.2.0'
22+
- 'Django~=3.0.0'
23+
- 'Django~=3.1.0'
24+
- 'Django~=3.2.0'
25+
- 'Django~=4.0.0'
26+
- 'Django~=4.1.0'
27+
experimental: [false]
28+
# include:
29+
# - python: '3.9'
30+
# django: 'https://github.com/django/django/archive/refs/heads/main.zip#egg=Django'
31+
# experimental: true
32+
# # NOTE this job will appear to pass even when it fails because of
33+
# # `continue-on-error: true`. Github Actions apparently does not
34+
# # have this feature, similar to Travis' allow-failure, yet.
35+
# # https://github.com/actions/toolkit/issues/399
36+
exclude:
37+
- python: '3.7'
38+
django: 'Django~=4.0.0'
39+
- python: '3.7'
40+
django: 'Django~=4.1.0'
41+
services:
42+
postgres:
43+
image: postgres:latest
44+
env:
45+
POSTGRES_DB: postgres
46+
POSTGRES_PASSWORD: postgres
47+
POSTGRES_USER: postgres
48+
ports:
49+
- 5432:5432
50+
options: >-
51+
--health-cmd pg_isready
52+
--health-interval 10s
53+
--health-timeout 5s
54+
--health-retries 5
55+
steps:
56+
- uses: actions/checkout@v2
57+
- uses: actions/setup-python@v2
58+
with:
59+
python-version: ${{ matrix.python }}
60+
- name: Setup
61+
run: |
62+
python --version
63+
pip install --upgrade pip wheel
64+
pip install -r requirements/requirements.txt
65+
pip install -r requirements/requirements-testing.txt
66+
pip install "${{ matrix.django }}"
67+
pip freeze
68+
- name: Run tests
69+
env:
70+
DB_SETTINGS: >-
71+
{
72+
"ENGINE":"django.db.backends.postgresql_psycopg2",
73+
"NAME":"entity",
74+
"USER":"postgres",
75+
"PASSWORD":"postgres",
76+
"HOST":"localhost",
77+
"PORT":"5432"
78+
}
79+
run: |
80+
coverage run manage.py test entity
81+
coverage report --fail-under=99
82+
continue-on-error: ${{ matrix.experimental }}
83+
- name: Check style
84+
run: flake8 entity

.travis.yml

-39
This file was deleted.

entity/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ class EntityConfig(AppConfig):
77

88
def ready(self):
99
import entity.signal_handlers
10-
assert(entity)
10+
assert entity

entity/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '5.1.1'
1+
__version__ = '6.0.0'

release_notes.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Release Notes
22

3+
- 6.0.0:
4+
- django support for 2.2-4.1
5+
- python support for 3.7-3.9
36
- 5.1.1:
47
- Fix logic holes related to the active flag when generating entity group cache
58
- 5.1.0:

requirements/requirements-testing.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
coverage==4.5.1
2-
django-nose==1.4.5
1+
coverage
2+
django-nose
33
django-dynamic-fixture
4-
mock==2.0.0
5-
psycopg2>=2.7.7
4+
mock
5+
psycopg2
6+
flake8

settings.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import json
23

34
from django.conf import settings
45

@@ -14,24 +15,27 @@ def configure_settings():
1415
test_db = os.environ.get('DB', None)
1516
if test_db is None:
1617
db_config = {
17-
'ENGINE': 'django.db.backends.postgresql_psycopg2',
18-
'NAME': 'ambition',
19-
'USER': 'ambition',
20-
'PASSWORD': 'ambition',
18+
'ENGINE': 'django.db.backends.postgresql',
19+
'NAME': 'entity',
20+
'USER': 'postgres',
21+
'PASSWORD': '',
2122
'HOST': 'db',
22-
'TEST': {
23-
'CHARSET': 'UTF8',
24-
}
2523
}
2624
elif test_db == 'postgres':
2725
db_config = {
28-
'ENGINE': 'django.db.backends.postgresql_psycopg2',
29-
'USER': 'postgres',
26+
'ENGINE': 'django.db.backends.postgresql',
3027
'NAME': 'entity',
28+
'USER': 'postgres',
29+
'PASSWORD': '',
30+
'HOST': 'db',
3131
}
3232
else:
3333
raise RuntimeError('Unsupported test DB {0}'.format(test_db))
3434

35+
# Check env for db override (used for github actions)
36+
if os.environ.get('DB_SETTINGS'):
37+
db_config = json.loads(os.environ.get('DB_SETTINGS'))
38+
3539
installed_apps = [
3640
'django.contrib.auth',
3741
'django.contrib.contenttypes',
@@ -43,6 +47,7 @@ def configure_settings():
4347

4448
settings.configure(
4549
TEST_RUNNER='django_nose.NoseTestSuiteRunner',
50+
SECRET_KEY='*',
4651
NOSE_ARGS=['--nocapture', '--nologcapture', '--verbosity=1'],
4752
DATABASES={
4853
'default': db_config,

setup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,19 @@ def get_lines(file_path):
3838
packages=find_packages(),
3939
classifiers=[
4040
'Programming Language :: Python',
41-
'Programming Language :: Python :: 3.6',
4241
'Programming Language :: Python :: 3.7',
4342
'Programming Language :: Python :: 3.8',
43+
'Programming Language :: Python :: 3.9',
4444
'Intended Audience :: Developers',
4545
'License :: OSI Approved :: MIT License',
4646
'Operating System :: OS Independent',
4747
'Framework :: Django',
48+
'Framework :: Django :: 2.2',
49+
'Framework :: Django :: 3.0',
50+
'Framework :: Django :: 3.1',
51+
'Framework :: Django :: 3.2',
52+
'Framework :: Django :: 4.0',
53+
'Framework :: Django :: 4.1',
4854
],
4955
install_requires=install_requires,
5056
tests_require=tests_require,

tox.ini

-31
This file was deleted.

0 commit comments

Comments
 (0)