From a63acf0ddf4475e4af5444995dbb2911c2fc4053 Mon Sep 17 00:00:00 2001 From: Jeff Triplett Date: Fri, 9 Aug 2024 14:45:36 -0500 Subject: [PATCH 1/5] :arrow_up: Adds support for Django 5.1 --- .github/workflows/actions.yml | 6 ++++++ noxfile.py | 40 +++++++++++++++++++++++++++++++---- setup.cfg | 3 +-- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 991872b..6edc676 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -28,6 +28,7 @@ jobs: - "3.2" # LTS - "4.2" # LTS - "5.0" + - "5.1" drf-version: - "" - "3.14" # only testing latest version for now @@ -43,6 +44,11 @@ jobs: django-version: "5.0" - python-version: "3.9" django-version: "5.0" + # Django 5.1 is compatible with Python 3.10+ + - python-version: "3.8" + django-version: "5.0" + - python-version: "3.9" + django-version: "5.0" steps: - uses: actions/checkout@v4 diff --git a/noxfile.py b/noxfile.py index c4cce9b..bad7247 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,16 +1,19 @@ import nox -DJANGO_VERSIONS = ["3.2", "4.2", "5.0"] -DRF_VERSIONS = ["3.11", "3.12", "3.13", "3.14"] +DJANGO_VERSIONS = ["3.2", "4.2", "5.0", "5.1"] +DRF_VERSIONS = ["3.11", "3.12", "3.13", "3.14", ] PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"] INVALID_PYTHON_DJANGO_SESSIONS = [ - ("3.8", "5.0"), ("3.9", "5.0"), + ("3.8", "5.1"), + ("3.9", "5.1"), ("3.11", "3.2"), ("3.12", "3.2"), ] +nox.options.default_venv_backend = "uv|venv" +nox.options.reuse_existing_virtualenvs = True @nox.session(python=PYTHON_VERSIONS, tags=["django"], venv_backend="uv") @nox.parametrize("django", DJANGO_VERSIONS) @@ -23,10 +26,39 @@ def tests(session: nox.Session, django: str) -> None: @nox.session(python=["3.10"], tags=["drf"], venv_backend="uv") -@nox.parametrize("django", ["3.2"]) +@nox.parametrize("django", ["4.2"]) @nox.parametrize("drf", DRF_VERSIONS) def tests_drf(session: nox.Session, django: str, drf: str) -> None: session.install(".[test]") session.install(f"django~={django}") session.install(f"djangorestframework~={drf}") session.run("pytest", *session.posargs) + + +@nox.session +@nox.parametrize( + "env", [ + ("3.9", "3.2", None), + ("3.9", "4.2", None), + ("3.9", "3.2", "3.12"), + ("3.9", "4.2", "3.12"), + ] +) +def tests_env(session, env): + python_version, django_version, drf_version = env + # Specify the Python version for the session + session.python = python_version + + # # Install Django + # session.install(f"Django=={django_version}") + + # # Install DRF if specified + # if drf_version: + # session.install(f"djangorestframework=={drf_version}") + + # # Additional dependencies + # # session.install('pytest', 'pytest-django') + + # # Run your tests + # session.run("pytest") + session.run("python", "--version") diff --git a/setup.cfg b/setup.cfg index e3b1c01..187afbf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,10 +17,9 @@ classifiers = Environment :: Web Environment Framework :: Django Framework :: Django :: 3.2 - Framework :: Django :: 4.0 - Framework :: Django :: 4.1 Framework :: Django :: 4.2 Framework :: Django :: 5.0 + Framework :: Django :: 5.1 Framework :: Pytest Intended Audience :: Developers License :: OSI Approved :: BSD License From efd36803170467aa26a66fa9d0767ace361ed0e8 Mon Sep 17 00:00:00 2001 From: Jeff Triplett Date: Fri, 9 Aug 2024 14:48:55 -0500 Subject: [PATCH 2/5] :shirt: Lints --- noxfile.py | 1 + test_project/test_project/settings.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index bad7247..d6c41e3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -15,6 +15,7 @@ nox.options.default_venv_backend = "uv|venv" nox.options.reuse_existing_virtualenvs = True + @nox.session(python=PYTHON_VERSIONS, tags=["django"], venv_backend="uv") @nox.parametrize("django", DJANGO_VERSIONS) def tests(session: nox.Session, django: str) -> None: diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index 4953add..3adae1e 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -108,4 +108,3 @@ REST_FRAMEWORK = { 'TEST_REQUEST_DEFAULT_FORMAT': 'json', } - From 8548baf780129b75ee0ed4776680f3cf58125767 Mon Sep 17 00:00:00 2001 From: Jeff Triplett Date: Fri, 9 Aug 2024 14:52:48 -0500 Subject: [PATCH 3/5] :arrow_up: Upgrades matrix to 5.1 --- .github/workflows/actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 6edc676..7f8a7de 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -46,9 +46,9 @@ jobs: django-version: "5.0" # Django 5.1 is compatible with Python 3.10+ - python-version: "3.8" - django-version: "5.0" + django-version: "5.1" - python-version: "3.9" - django-version: "5.0" + django-version: "5.1" steps: - uses: actions/checkout@v4 From 4c6791245f52ac337699594657875a02ff514477 Mon Sep 17 00:00:00 2001 From: Jeff Triplett Date: Fri, 9 Aug 2024 14:54:55 -0500 Subject: [PATCH 4/5] :pencil: Updates README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 640781b..2c3a0c3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ to help your team dramatically improve your productivity. Supports: Python 3.8, 3.9, 3.10, 3.11, and 3.12. -Supports Django Versions: 3.2, 4.2, and 5.0. +Supports Django Versions: 3.2, 4.2, 5.0, and 5.1. ## Documentation From 17a31fcb7d036b158fe8a2385e6f78a861d951f7 Mon Sep 17 00:00:00 2001 From: Jeff Triplett Date: Fri, 9 Aug 2024 14:58:20 -0500 Subject: [PATCH 5/5] :fire: Removes code I never meant to commit --- noxfile.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/noxfile.py b/noxfile.py index d6c41e3..44232cd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -34,32 +34,3 @@ def tests_drf(session: nox.Session, django: str, drf: str) -> None: session.install(f"django~={django}") session.install(f"djangorestframework~={drf}") session.run("pytest", *session.posargs) - - -@nox.session -@nox.parametrize( - "env", [ - ("3.9", "3.2", None), - ("3.9", "4.2", None), - ("3.9", "3.2", "3.12"), - ("3.9", "4.2", "3.12"), - ] -) -def tests_env(session, env): - python_version, django_version, drf_version = env - # Specify the Python version for the session - session.python = python_version - - # # Install Django - # session.install(f"Django=={django_version}") - - # # Install DRF if specified - # if drf_version: - # session.install(f"djangorestframework=={drf_version}") - - # # Additional dependencies - # # session.install('pytest', 'pytest-django') - - # # Run your tests - # session.run("pytest") - session.run("python", "--version")