diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 829d4a7..1ba3540 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -14,28 +14,14 @@ jobs: strategy: matrix: django-version: - - "2.2" - - "3.0" - - "3.1" - "3.2" - - "4.0" - "4.1" + - "4.2" python-version: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - exclude: - - python-version: "3.6" - django-version: "4.0" - - python-version: "3.7" - django-version: "4.0" - - python-version: "3.6" - django-version: "4.1" - - python-version: "3.7" - django-version: "4.1" - steps: - uses: actions/checkout@v3 diff --git a/noxfile.py b/noxfile.py index e393f78..00f7ecf 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,26 +1,29 @@ import nox -DJANGO_VERSIONS = ["2.2", "3.2", "4.0", "4.1"] -PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - -INVALID_PYTHON_DJANGO_SESSIONS = [ - ("3.6", "4.0"), - ("3.6", "4.1"), - ("3.6", "4.2"), - ("3.7", "4.0"), - ("3.7", "4.1"), - ("3.7", "4.2"), - ("3.11", "3.2"), - # ("3.11", "4.0"), - # ("3.11", "4.1"), -] - - -@nox.session(python=PYTHON_VERSIONS, tags=["django"]) + +DJANGO_STABLE_VERSION = ["4.2"] +DJANGO_VERSIONS = ["3.2", "4.1", "main"] + +PYTHON_STABLE_VERSION = ["3.11"] +PYTHON_VERSIONS = ["3.8", "3.9", "3.10"] + + +@nox.session(python=PYTHON_STABLE_VERSION, tags=["django"]) @nox.parametrize("django", DJANGO_VERSIONS) -def tests(session: nox.Session, django: str) -> None: - if (session.python, django) in INVALID_PYTHON_DJANGO_SESSIONS: - session.skip() +def test_django_version(session: nox.Session, django: str) -> None: + session.install(".[test]") + + if django == "main": + session.install("https://github.com/django/django/archive/refs/heads/main.zip") + else: + session.install(f"django~={django}") + + session.run("pytest", *session.posargs) + + +@nox.session(python=PYTHON_VERSIONS, tags=["python"]) +@nox.parametrize("django", DJANGO_STABLE_VERSION) +def test_python_version(session: nox.Session, django: str) -> None: session.install(".[test]") session.install(f"django~={django}") session.run("pytest", *session.posargs) diff --git a/requirements.in b/requirements.in index 20bd865..857f920 100644 --- a/requirements.in +++ b/requirements.in @@ -1,6 +1,6 @@ bumpversion check-manifest -Django<4.2 +Django<5.0 factory-boy flake8 nox diff --git a/requirements.txt b/requirements.txt index 2ad4b79..857f920 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,144 +1,12 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --resolver=backtracking -# -argcomplete==2.0.0 - # via nox -asgiref==3.6.0 - # via django -attrs==22.2.0 - # via pytest -bleach==5.0.1 - # via readme-renderer -build==0.10.0 - # via check-manifest -bump2version==1.0.1 - # via bumpversion -bumpversion==0.6.0 - # via -r requirements.in -certifi==2022.12.7 - # via requests -charset-normalizer==3.0.1 - # via requests -check-manifest==0.49 - # via -r requirements.in -colorlog==6.7.0 - # via nox -commonmark==0.9.1 - # via rich -coverage[toml]==7.0.5 - # via pytest-cov -distlib==0.3.6 - # via virtualenv -django==4.1.5 - # via -r requirements.in -docutils==0.19 - # via readme-renderer -factory-boy==3.2.1 - # via -r requirements.in -faker==16.4.0 - # via factory-boy -filelock==3.9.0 - # via virtualenv -flake8==6.0.0 - # via -r requirements.in -idna==3.4 - # via requests -importlib-metadata==6.0.0 - # via - # keyring - # twine -iniconfig==2.0.0 - # via pytest -jaraco-classes==3.2.3 - # via keyring -keyring==23.13.1 - # via twine -mccabe==0.7.0 - # via flake8 -more-itertools==9.0.0 - # via jaraco-classes -nox==2022.11.21 - # via -r requirements.in -packaging==23.0 - # via - # build - # nox - # pytest -pkginfo==1.9.6 - # via twine -platformdirs==2.6.2 - # via virtualenv -pluggy==1.0.0 - # via pytest -py==1.11.0 - # via pytest -pycodestyle==2.10.0 - # via flake8 -pyflakes==3.0.1 - # via - # -r requirements.in - # flake8 -pygments==2.14.0 - # via - # readme-renderer - # rich -pyproject-hooks==1.0.0 - # via build -pytest==6.2.5 - # via - # -r requirements.in - # pytest-cov - # pytest-django - # pytest-pythonpath -pytest-cov==4.0.0 - # via -r requirements.in -pytest-django==4.5.2 - # via -r requirements.in -pytest-pythonpath==0.7.4 - # via -r requirements.in -python-dateutil==2.8.2 - # via faker -readme-renderer==37.3 - # via twine -requests==2.28.2 - # via - # requests-toolbelt - # twine -requests-toolbelt==0.10.1 - # via twine -rfc3986==2.0.0 - # via twine -rich==13.1.0 - # via twine -six==1.16.0 - # via - # bleach - # python-dateutil -sqlparse==0.4.3 - # via django -toml==0.10.2 - # via pytest -tomli==2.0.1 - # via - # build - # check-manifest - # coverage - # pyproject-hooks -twine==4.0.2 - # via -r requirements.in -urllib3==1.26.14 - # via - # requests - # twine -virtualenv==20.17.1 - # via nox -webencodings==0.5.1 - # via bleach -zipp==3.11.0 - # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# setuptools +bumpversion +check-manifest +Django<5.0 +factory-boy +flake8 +nox +pyflakes +pytest +pytest-cov +pytest-django +pytest-pythonpath +twine diff --git a/setup.cfg b/setup.cfg index bb0f439..2ba4939 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,23 +9,19 @@ author = Frank Wiles author_email = frank@revsys.com license = BSD-3-Clause license_file = LICENSE.txt -classifiers = +classifiers = Development Status :: 5 - Production/Stable Environment :: Web Environment Framework :: Django - Framework :: Django :: 2.2 - Framework :: Django :: 3.0 - Framework :: Django :: 3.1 Framework :: Django :: 3.2 - Framework :: Django :: 4.0 Framework :: Django :: 4.1 + Framework :: Django :: 4.2 Framework :: Pytest Intended Audience :: Developers License :: OSI Approved :: BSD License Operating System :: OS Independent Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -40,8 +36,8 @@ zip_safe = False tests_require = django-friendship[test] [options.extras_require] -test = - black==21.7b0 +test = + black pytest pytest-django pytest-cov @@ -54,8 +50,9 @@ universal = 1 [flake8] ignore = E203, E501, W503 select = C,E,F,W,B,B950 -exclude = +exclude = .git, + .nox, .tox, docs, *migrations*,