Skip to content

Commit

Permalink
Drop Python 3.8. Add Django 5.1 and Python 3.13 (#348)
Browse files Browse the repository at this point in the history
* Add Django 5.1 and Python 3.13 to test matrix.

* Bump setup-python and allow pre-releases.

* Drop python 3.8

It was limiting our installation of cffi which caused
errors for cryptography and python 3.13.

* Exclude Django 4.2 and Python 3.13 from test suite.

* Use the latest patches for Django and DRF

* Disconnect the post_save signal handler to avoid test leakage
  • Loading branch information
tim-schilling authored Oct 18, 2024
1 parent 5ea3c87 commit 9799b46
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 399 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10.5"
- name: Install poetry
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Install poetry
uses: snok/install-poetry@v1
- name: Build and publish
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3"
- uses: actions/cache@v3
Expand All @@ -30,21 +30,25 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12"]
django-version: [ "4.2", "5.0"]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13"]
django-version: [ "4.2", "5.0", "5.1"]
drf-version: [ "3.11", "3.12", "3.13" ]
exclude:
# Python 3.8 is incompatible with Django v5+
- django-version: 5.0
python-version: 3.8
# Python 3.9 is incompatible with Django v5+
- django-version: 5.0
python-version: 3.9
# Python 3.9 is incompatible with Django v5+
- django-version: 5.1
python-version: 3.9
# Django 4.2 is incompatible with Python 3.13+
- django-version: 4.2
python-version: 3.13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true
Expand All @@ -58,8 +62,8 @@ jobs:
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- run: |
source .venv/bin/activate
pip install "Django==${{ matrix.django-version }}"
pip install "djangorestframework==${{ matrix.drf-version }}"
pip install "Django~=${{ matrix.django-version }}.0"
pip install "djangorestframework~=${{ matrix.drf-version }}.0"
- name: Run tests
run: |
source .venv/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Installation
Requirements
------------

* Python 3.8 and above
* Python 3.9 and above
* Django 4.2 and above

You will also need the following:
Expand Down
773 changes: 391 additions & 382 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ classifiers = [
'Environment :: Web Environment',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Framework :: Django :: 5.1',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Operating System :: OS Independent',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'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',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Internet :: WWW/HTTP :: WSGI',
Expand All @@ -34,9 +35,9 @@ classifiers = [
]

[tool.poetry.dependencies]
python = '^3.8'
python = '^3.9'
django = [
{ version = '^4.2', python = '>=3.8 <3.10' },
{ version = '^4.2', python = '>=3.9 <3.10' },
{ version = '^4.2 || ^5', python = '>=3.10' },
]
requests = '*'
Expand Down
1 change: 1 addition & 0 deletions tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def create_profile(sender, instance, created, **kwargs):
self.assertEqual(user.last_name, "Doe")
self.assertEqual(user.email, "[email protected]")
self.assertEqual(user.profile.employee_id, 182)
post_save.disconnect(create_profile, sender=User)

@mock_adfs("2016")
def test_authentication(self):
Expand Down

0 comments on commit 9799b46

Please sign in to comment.