Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9']
# Time to switch to pytest or nose2??
# nosetests is broken on 3.10
# AttributeError: module 'collections' has no attribute 'Callable'
# https://github.com/nose-devs/nose/issues/1099
# Track the Django versions with upstream support (currently 5.2 LTS and
# 6.0) and the python versions each of them supports.
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
django:
- 'Django~=3.2.0'
- 'Django~=4.0.0'
- 'Django~=4.1.0'
- 'Django~=4.2.0'
- 'Django~=5.2.0'
- 'Django~=6.0.0'
psycopg:
- 'psycopg2~=2.9.10'
- 'psycopg~=3.2.0'
experimental: [false]
exclude:
- python: '3.7'
django: 'Django~=4.0.0'
- python: '3.7'
django: 'Django~=4.1.0'
- python: '3.7'
django: 'Django~=4.2.0'
# Django 6.0 supports python 3.12+
- python: '3.10'
django: 'Django~=6.0.0'
- python: '3.11'
django: 'Django~=6.0.0'
services:
postgres:
image: postgres:latest
Expand All @@ -45,8 +43,8 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup
Expand All @@ -56,20 +54,21 @@ jobs:
pip install -r requirements/requirements.txt
pip install -r requirements/requirements-testing.txt
pip install "${{ matrix.django }}"
pip install "${{ matrix.psycopg }}"
pip freeze
- name: Run tests
env:
DB_SETTINGS: >-
{
"ENGINE":"django.db.backends.postgresql_psycopg2",
"ENGINE":"django.db.backends.postgresql",
"NAME":"dynamic_initial_data",
"USER":"postgres",
"PASSWORD":"postgres",
"HOST":"localhost",
"PORT":"5432"
}
run: |
coverage run manage.py test dynamic_initial_data
coverage run manage.py test dynamic_initial_data --pattern="*_tests.py"
coverage report --fail-under=99
continue-on-error: ${{ matrix.experimental }}
- name: Check style
Expand Down
11 changes: 11 additions & 0 deletions dynamic_initial_data/docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Release Notes
=============

v3.0.0
------
* Support django 5.2 and 6.0, python 3.10 - 3.14
* Drop support for python < 3.10 and django < 5.2
* Require django-manager-utils >= 4.0.0 (the release line tested against the
same django/python matrix)
* Replace django-nose with Django's ``DiscoverRunner``
* Set ``USE_TZ=False`` explicitly in the test settings (django 5.0 flipped the
default to True)
* Replace ``assertEquals`` (removed in python 3.12) with ``assertEqual``

v2.2.1
------
* Fix manifest
Expand Down
2 changes: 1 addition & 1 deletion dynamic_initial_data/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.2.1'
__version__ = '3.0.0'
4 changes: 1 addition & 3 deletions requirements/requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
coverage
django-dynamic-fixture
django-nose
freezegun
psycopg2
flake8
freezegun
5 changes: 2 additions & 3 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Minimum requirements
Django>=3.2
django-manager-utils>=3.1.0
Django>=5.2
django-manager-utils>=4.0.0
7 changes: 4 additions & 3 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
configure_settings()
django.setup()

# Django nose must be imported here since it depends on the settings being configured
from django_nose import NoseTestSuiteRunner
# The test runner must be imported here since it depends on the settings being configured
from django.test.runner import DiscoverRunner


def run_tests(*test_args, **kwargs):
if not test_args:
test_args = ['dynamic_initial_data']

kwargs.setdefault('interactive', False)
kwargs.setdefault('pattern', '*_tests.py')

test_runner = NoseTestSuiteRunner(**kwargs)
test_runner = DiscoverRunner(**kwargs)

failures = test_runner.run_tests(test_args)
sys.exit(failures)
Expand Down
3 changes: 1 addition & 2 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def configure_settings():
]

settings.configure(
TEST_RUNNER='django_nose.NoseTestSuiteRunner',
NOSE_ARGS=['--nocapture', '--nologcapture', '--verbosity=1'],
DATABASES={
'default': db_config,
},
Expand All @@ -79,6 +77,7 @@ def configure_settings():
TEMPLATES=templates,
ROOT_URLCONF='dynamic_initial_data.urls',
DEBUG=False,
USE_TZ=False,
SECRET_KEY='dj-dy-i-d',
DDF_FILL_NULLABLE_FIELDS=False,
)
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,20 @@ def get_lines(file_path):
packages=find_packages(),
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.2',
'Framework :: Django :: 6.0',
],
license='MIT',
python_requires='>=3.10',
install_requires=install_requires,
tests_require=tests_require,
test_suite='run_tests.run_tests',
Expand Down
Loading