Skip to content

Commit fa4bcdf

Browse files
authored
Update supported versions, remove eol dj22 and py37, add dj5 and py12 (#1350)
* Update tested versions * chore: remove remaining assertEquals
1 parent f580e2e commit fa4bcdf

File tree

7 files changed

+59
-47
lines changed

7 files changed

+59
-47
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,42 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
13-
django-version: ['2.2', '3.2', '4.0', '4.1', '4.2', 'main']
12+
python-version:
13+
- '3.8'
14+
- '3.9'
15+
- '3.10'
16+
- '3.11'
17+
- '3.12'
18+
django-version:
19+
- '3.2'
20+
- '4.0'
21+
- '4.1'
22+
- '4.2'
23+
- '5.0'
24+
- 'main'
1425
exclude:
1526
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
1627

17-
# Python 3.10+ is not supported by Django 2.2
18-
- python-version: '3.10'
19-
django-version: '2.2'
20-
21-
# Python 3.7 is not supported by Django 4.0+
22-
- python-version: '3.7'
23-
django-version: '4.0'
24-
- python-version: '3.7'
25-
django-version: '4.1'
26-
- python-version: '3.7'
27-
django-version: '4.2'
28-
- python-version: '3.7'
29-
django-version: 'main'
30-
3128
# < Python 3.10 is not supported by Django 5.0+
29+
- python-version: '3.8'
30+
django-version: '5.0'
31+
- python-version: '3.9'
32+
django-version: '5.0'
3233
- python-version: '3.8'
3334
django-version: 'main'
3435
- python-version: '3.9'
3536
django-version: 'main'
3637

38+
# Python 3.12 is not supported by Django < 5.0
39+
- python-version: '3.12'
40+
django-version: '3.2'
41+
- python-version: '3.12'
42+
django-version: '4.0'
43+
- python-version: '3.12'
44+
django-version: '4.1'
45+
- python-version: '3.12'
46+
django-version: '4.2'
47+
3748
steps:
3849
- uses: actions/checkout@v4
3950

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
* #1285 Add post_logout_redirect_uris field in application views.
2626
* #1311 Add option to disable client_secret hashing to allow verifying JWTs' signatures.
2727
* #1337 Gracefully handle expired or deleted refresh tokens, in `validate_user`.
28+
* #1350 Support Python 3.12 and Django 5.0
2829

29-
- ### Fixed
30+
### Fixed
3031
* #1322 Instructions in documentation on how to create a code challenge and code verifier
3132
* #1284 Allow to logout with no id_token_hint even if the browser session already expired
3233
* #1296 Added reverse function in migration 0006_alter_application_client_secret
3334
* #1336 Fix encapsulation for Redirect URI scheme validation
3435

36+
### Removed
37+
* #1350 Remove support for Python 3.7 and Django 2.2
38+
3539
## [2.3.0] 2023-05-31
3640

3741
### WARNING

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Please report any security issues to the JazzBand security team at <security@jaz
4343
Requirements
4444
------------
4545

46-
* Python 3.7+
47-
* Django 2.2, 3.2, 4.0 (4.0.1+ due to a regression), 4.1, or 4.2
46+
* Python 3.8+
47+
* Django 3.2, 4.0 (4.0.1+ due to a regression), 4.1, 4.2, or 5.0
4848
* oauthlib 3.1+
4949

5050
Installation

oauth2_provider/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
import django
2-
3-
41
__version__ = "2.3.0"
5-
6-
if django.VERSION < (3, 2):
7-
default_app_config = "oauth2_provider.apps.DOTConfig"

setup.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,31 @@ classifiers =
1212
Development Status :: 5 - Production/Stable
1313
Environment :: Web Environment
1414
Framework :: Django
15-
Framework :: Django :: 2.2
1615
Framework :: Django :: 3.2
1716
Framework :: Django :: 4.0
1817
Framework :: Django :: 4.1
1918
Framework :: Django :: 4.2
19+
Framework :: Django :: 5.0
2020
Intended Audience :: Developers
2121
License :: OSI Approved :: BSD License
2222
Operating System :: OS Independent
2323
Programming Language :: Python :: 3
24-
Programming Language :: Python :: 3.7
2524
Programming Language :: Python :: 3.8
2625
Programming Language :: Python :: 3.9
2726
Programming Language :: Python :: 3.10
2827
Programming Language :: Python :: 3.11
28+
Programming Language :: Python :: 3.12
2929
Topic :: Internet :: WWW/HTTP
3030

3131
[options]
3232
packages = find:
3333
include_package_data = True
3434
zip_safe = False
35+
python_requires = >=3.8
3536
# jwcrypto has a direct dependency on six, but does not list it yet in a release
3637
# Previously, cryptography also depended on six, so this was unnoticed
3738
install_requires =
38-
django >= 2.2, != 4.0.0
39+
django >= 3.2, != 4.0.0
3940
requests >= 2.13.0
4041
oauthlib >= 3.1.0
4142
jwcrypto >= 0.8.0

tests/test_application_views.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ def test_application_registration_user(self):
5757
app = get_application_model().objects.get(name="Foo app")
5858
self.assertEqual(app.user.username, "foo_user")
5959
app = Application.objects.get()
60-
self.assertEquals(app.name, form_data["name"])
61-
self.assertEquals(app.client_id, form_data["client_id"])
62-
self.assertEquals(app.redirect_uris, form_data["redirect_uris"])
63-
self.assertEquals(app.post_logout_redirect_uris, form_data["post_logout_redirect_uris"])
64-
self.assertEquals(app.client_type, form_data["client_type"])
65-
self.assertEquals(app.authorization_grant_type, form_data["authorization_grant_type"])
66-
self.assertEquals(app.algorithm, form_data["algorithm"])
60+
self.assertEqual(app.name, form_data["name"])
61+
self.assertEqual(app.client_id, form_data["client_id"])
62+
self.assertEqual(app.redirect_uris, form_data["redirect_uris"])
63+
self.assertEqual(app.post_logout_redirect_uris, form_data["post_logout_redirect_uris"])
64+
self.assertEqual(app.client_type, form_data["client_type"])
65+
self.assertEqual(app.authorization_grant_type, form_data["authorization_grant_type"])
66+
self.assertEqual(app.algorithm, form_data["algorithm"])
6767

6868

6969
class TestApplicationViews(BaseTest):
@@ -115,7 +115,7 @@ def test_application_detail_not_owner(self):
115115
response = self.client.get(reverse("oauth2_provider:detail", args=(self.app_bar_1.pk,)))
116116
self.assertEqual(response.status_code, 404)
117117

118-
def test_application_udpate(self):
118+
def test_application_update(self):
119119
self.client.login(username="foo_user", password="123456")
120120

121121
form_data = {
@@ -132,8 +132,8 @@ def test_application_udpate(self):
132132
self.assertRedirects(response, reverse("oauth2_provider:detail", args=(self.app_foo_1.pk,)))
133133

134134
self.app_foo_1.refresh_from_db()
135-
self.assertEquals(self.app_foo_1.client_id, form_data["client_id"])
136-
self.assertEquals(self.app_foo_1.redirect_uris, form_data["redirect_uris"])
137-
self.assertEquals(self.app_foo_1.post_logout_redirect_uris, form_data["post_logout_redirect_uris"])
138-
self.assertEquals(self.app_foo_1.client_type, form_data["client_type"])
139-
self.assertEquals(self.app_foo_1.authorization_grant_type, form_data["authorization_grant_type"])
135+
self.assertEqual(self.app_foo_1.client_id, form_data["client_id"])
136+
self.assertEqual(self.app_foo_1.redirect_uris, form_data["redirect_uris"])
137+
self.assertEqual(self.app_foo_1.post_logout_redirect_uris, form_data["post_logout_redirect_uris"])
138+
self.assertEqual(self.app_foo_1.client_type, form_data["client_type"])
139+
self.assertEqual(self.app_foo_1.authorization_grant_type, form_data["authorization_grant_type"])

tox.ini

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ envlist =
55
migrate_swapped,
66
docs,
77
sphinxlint,
8-
py{37,38,39}-dj22,
9-
py{37,38,39,310}-dj32,
8+
py{38,39,310}-dj32,
109
py{38,39,310}-dj40,
1110
py{38,39,310,311}-dj41,
12-
py{38,39,310,311}-dj42,
13-
py{310,311}-djmain,
11+
py{38,39,310,311,312}-dj42,
12+
py{310,311,312}-dj50,
13+
py{310,311,312}-djmain,
1414

1515
[gh-actions]
1616
python =
17-
3.7: py37
1817
3.8: py38, docs, flake8, migrations, migrate_swapped, sphinxlint
1918
3.9: py39
2019
3.10: py310
2120
3.11: py311
21+
3.12: py312
2222

2323
[gh-actions:env]
2424
DJANGO =
@@ -27,6 +27,7 @@ DJANGO =
2727
4.0: dj40
2828
4.1: dj41
2929
4.2: dj42
30+
5.0: dj50
3031
main: djmain
3132

3233
[pytest]
@@ -54,6 +55,7 @@ deps =
5455
dj40: Django>=4.0.0,<4.1
5556
dj41: Django>=4.1,<4.2
5657
dj42: Django>=4.2,<4.3
58+
dj50: Django>=5.0b1,<5.1
5759
djmain: https://github.com/django/django/archive/main.tar.gz
5860
djangorestframework
5961
oauthlib>=3.1.0
@@ -68,7 +70,7 @@ deps =
6870
passenv =
6971
PYTEST_ADDOPTS
7072

71-
[testenv:py{38,39,310}-djmain]
73+
[testenv:py{310,311,312}-djmain]
7274
ignore_errors = true
7375
ignore_outcome = true
7476

0 commit comments

Comments
 (0)