From e3fe73bbb85e78bad6dda981e0f5304f0a28d30b Mon Sep 17 00:00:00 2001 From: wes okes Date: Tue, 7 Jul 2026 19:05:07 -0400 Subject: [PATCH 1/2] Support the Django versions with upstream support (5.2, 6.0) Django>=5.2 in install requirements, python_requires>=3.10, refreshed classifiers, version 3.0.0. django-nose (dead upstream, broken on python 3.10+) replaced with Django's DiscoverRunner, passing an explicit pattern for the *_tests.py naming scheme. USE_TZ=False set explicitly since django 5.0 flipped the default and the deletion-receipt tests assume naive datetimes. assertEquals (removed in python 3.12) replaced with assertEqual. CI matrix: python 3.10-3.14 x Django 5.2/6.0 x psycopg2/psycopg 3.2. Verified on python 3.14 / Django 6.0.6 / psycopg 3.2.10 against Postgres 17: all 32 tests pass, flake8 clean. Co-Authored-By: Claude Fable 5 --- .github/workflows/tests.yml | 37 ++++++++++----------- dynamic_initial_data/docs/release_notes.rst | 9 +++++ dynamic_initial_data/version.py | 2 +- requirements/requirements-testing.txt | 4 +-- requirements/requirements.txt | 3 +- run_tests.py | 7 ++-- settings.py | 3 +- setup.py | 15 +++++---- 8 files changed, 43 insertions(+), 37 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 633745a..7ac06a2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -56,12 +54,13 @@ 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", @@ -69,7 +68,7 @@ jobs: "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 diff --git a/dynamic_initial_data/docs/release_notes.rst b/dynamic_initial_data/docs/release_notes.rst index 282ad23..855ed4f 100644 --- a/dynamic_initial_data/docs/release_notes.rst +++ b/dynamic_initial_data/docs/release_notes.rst @@ -1,6 +1,15 @@ 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 +* 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 diff --git a/dynamic_initial_data/version.py b/dynamic_initial_data/version.py index 36a511e..4eb28e3 100644 --- a/dynamic_initial_data/version.py +++ b/dynamic_initial_data/version.py @@ -1 +1 @@ -__version__ = '2.2.1' +__version__ = '3.0.0' diff --git a/requirements/requirements-testing.txt b/requirements/requirements-testing.txt index fdc2b98..4c36382 100644 --- a/requirements/requirements-testing.txt +++ b/requirements/requirements-testing.txt @@ -1,6 +1,4 @@ coverage django-dynamic-fixture -django-nose -freezegun -psycopg2 flake8 +freezegun diff --git a/requirements/requirements.txt b/requirements/requirements.txt index e1a62d4..13d09b5 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,3 +1,2 @@ -# Minimum requirements -Django>=3.2 +Django>=5.2 django-manager-utils>=3.1.0 diff --git a/run_tests.py b/run_tests.py index 13da7cc..a447106 100644 --- a/run_tests.py +++ b/run_tests.py @@ -13,8 +13,8 @@ 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): @@ -22,8 +22,9 @@ def run_tests(*test_args, **kwargs): 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) diff --git a/settings.py b/settings.py index adb9fa5..5f50198 100644 --- a/settings.py +++ b/settings.py @@ -69,8 +69,6 @@ def configure_settings(): ] settings.configure( - TEST_RUNNER='django_nose.NoseTestSuiteRunner', - NOSE_ARGS=['--nocapture', '--nologcapture', '--verbosity=1'], DATABASES={ 'default': db_config, }, @@ -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, ) diff --git a/setup.py b/setup.py index 68ab34c..62b90e3 100644 --- a/setup.py +++ b/setup.py @@ -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', From 2a8db2300163a14954e972937974ef48d3c1ab14 Mon Sep 17 00:00:00 2001 From: wes okes Date: Tue, 7 Jul 2026 20:18:11 -0400 Subject: [PATCH 2/2] Require django-manager-utils 4.0.0 The 4.x line is the one tested against the same django/python matrix this release supports. Co-Authored-By: Claude Fable 5 --- dynamic_initial_data/docs/release_notes.rst | 2 ++ requirements/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dynamic_initial_data/docs/release_notes.rst b/dynamic_initial_data/docs/release_notes.rst index 855ed4f..44fbbbd 100644 --- a/dynamic_initial_data/docs/release_notes.rst +++ b/dynamic_initial_data/docs/release_notes.rst @@ -5,6 +5,8 @@ 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) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 13d09b5..afe9146 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,2 +1,2 @@ Django>=5.2 -django-manager-utils>=3.1.0 +django-manager-utils>=4.0.0