diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 0bf5215..e10bcde 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -19,8 +19,6 @@ jobs: fail-fast: false matrix: python-version: - - "3.6" - - "3.7" - "3.8" - "3.9" - "3.10" @@ -29,8 +27,8 @@ jobs: django-version: - "2.2" # LTS - "3.2" # LTS - - "4.1" - "4.2" # LTS + - "5.0" drf-version: - "" - "3.14" # only testing latest version for now @@ -54,45 +52,39 @@ jobs: django-version: "2.2" - python-version: "3.12" django-version: "3.2" - # Django 4.0 is compatible with Python 3.8+ - - python-version: "3.6" - django-version: "4.0" - - python-version: "3.7" - django-version: "4.0" - # Django 4.1 is compatible with Python 3.8+ - - python-version: "3.6" - django-version: "4.1" - - python-version: "3.7" - django-version: "4.1" - # Django 4.2 is compatible with Python 3.8+ - - python-version: "3.6" - django-version: "4.2" - - python-version: "3.7" - django-version: "4.2" + # Django 5.0 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@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" cache-dependency-path: '**/setup.cfg' + - name: Install dependencies + run: | + python -m pip install uv + - name: Install Django ${{ matrix.django-version }} if: ${{ matrix.drf-version == '' }} run: | - python -m pip install "Django~=${{ matrix.django-version }}.0" + python -m uv pip install --system "Django~=${{ matrix.django-version }}.0" - name: Install DRF ${{ matrix.drf-version }} and Django ${{ matrix.django-version }} if: ${{ matrix.drf-version }} run: | - python -m pip install pytz "djangorestframework~=${{ matrix.drf-version }}.0" "Django~=${{ matrix.django-version }}.0" + python -m uv pip install --system pytz "djangorestframework~=${{ matrix.drf-version }}.0" "Django~=${{ matrix.django-version }}.0" - name: Install dependencies run: | - python -m pip install -e ".[test]" + python -m uv pip install --system -e ".[test]" - run: | pytest . diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b288be1..7841c00 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,10 +13,10 @@ jobs: PYTHONDONTWRITEBYTECODE: true PYTHONPATH: test_project steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" cache: "pip" @@ -24,8 +24,9 @@ jobs: - name: Install dependencies run: | - python -m pip install -e "." - python -m pip install -e ".[test]" + python -m pip install uv + python -m uv pip install --system -e "." + python -m uv pip install --system -e ".[test]" - name: Lint with flake8 run: | diff --git a/noxfile.py b/noxfile.py index f20aed7..e1b9c5d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,16 +1,17 @@ import nox -DJANGO_VERSIONS = ["2.2", "3.2", "4.1", "4.2"] +DJANGO_VERSIONS = ["2.2", "3.2", "4.2", "5.0"] 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.11", "3.2"), + ("3.12", "2.2"), ("3.12", "3.2"), ] -@nox.session(python=PYTHON_VERSIONS, tags=["django"]) +@nox.session(python=PYTHON_VERSIONS, tags=["django"], venv_backend="uv") @nox.parametrize("django", DJANGO_VERSIONS) def tests(session: nox.Session, django: str) -> None: if (session.python, django) in INVALID_PYTHON_DJANGO_SESSIONS: @@ -20,7 +21,7 @@ def tests(session: nox.Session, django: str) -> None: session.run("pytest", *session.posargs) -@nox.session(python=["3.10"], tags=["drf"]) +@nox.session(python=["3.10"], tags=["drf"], venv_backend="uv") @nox.parametrize("django", ["3.2"]) @nox.parametrize("drf", DRF_VERSIONS) def tests_drf(session: nox.Session, django: str, drf: str) -> None: diff --git a/setup.cfg b/setup.cfg index 786a5a9..d75f59a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,13 +21,12 @@ classifiers = Framework :: Django :: 4.0 Framework :: Django :: 4.1 Framework :: Django :: 4.2 + Framework :: Django :: 5.0 Framework :: Pytest Intended Audience :: Developers License :: OSI Approved :: BSD License Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -39,10 +38,11 @@ include_package_data = True packages = find: zip_safe = False setup_requires = + packaging pytest-runner pytest-django tests_require = django-test-plus[test] -python_requires = >=3.6 +python_requires = >=3.8 [options.entry_points] pytest11 = @@ -53,9 +53,9 @@ test = factory-boy flake8 pyflakes - pytest>=7.0 pytest-cov pytest-django + pytest [aliases] test = pytest