Skip to content

Commit

Permalink
Support Python 3.12 (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Jun 16, 2023
1 parent f9e237d commit 9ea1f6f
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: 'requirements/*.txt'

Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ repos:
- id: setup-cfg-fmt
args:
- --include-version-classifiers
- --max-py-version
- '3.12'
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Compatibility
-------------

WhiteNoise works with any WSGI-compatible application and is tested on Python
**3.7** – **3.11**, on both Linux and Windows.
**3.7** – **3.12**, on both Linux and Windows.

Django WhiteNoiseMiddleware is tested with Django versions **3.2** --- **4.1**

Expand Down
12 changes: 12 additions & 0 deletions requirements/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,15 @@
check=True,
capture_output=True,
)
subprocess.run(
[
"python3.12",
*common_args,
"-P",
"Django>=4.2a1,<5.0",
"-o",
"py312-django42.txt",
],
check=True,
capture_output=True,
)
2 changes: 1 addition & 1 deletion requirements/py310-django42.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ charset-normalizer==3.1.0
# via requests
coverage==7.2.7
# via -r requirements.in
django==4.2.1
django==4.2.2
# via -r requirements.in
exceptiongroup==1.1.1
# via pytest
Expand Down
2 changes: 1 addition & 1 deletion requirements/py311-django42.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ charset-normalizer==3.1.0
# via requests
coverage==7.2.7
# via -r requirements.in
django==4.2.1
django==4.2.2
# via -r requirements.in
idna==3.4
# via requests
Expand Down
38 changes: 38 additions & 0 deletions requirements/py312-django42.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# requirements/compile.py
#
asgiref==3.7.2
# via django
brotli==1.0.9
# via -r requirements.in
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
# via requests
coverage==7.2.7
# via -r requirements.in
django==4.2.2
# via -r requirements.in
idna==3.4
# via requests
iniconfig==2.0.0
# via pytest
packaging==23.1
# via pytest
pluggy==1.0.0
# via pytest
pytest==7.3.2
# via
# -r requirements.in
# pytest-randomly
pytest-randomly==3.12.0
# via -r requirements.in
requests==2.31.0
# via -r requirements.in
sqlparse==0.4.4
# via django
urllib3==2.0.3
# via requests
2 changes: 1 addition & 1 deletion requirements/py38-django42.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ charset-normalizer==3.1.0
# via requests
coverage==7.2.7
# via -r requirements.in
django==4.2.1
django==4.2.2
# via -r requirements.in
exceptiongroup==1.1.1
# via pytest
Expand Down
2 changes: 1 addition & 1 deletion requirements/py39-django42.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ charset-normalizer==3.1.0
# via requests
coverage==7.2.7
# via -r requirements.in
django==4.2.1
django==4.2.2
# via -r requirements.in
exceptiongroup==1.1.1
# via pytest
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
Typing :: Typed
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
requires =
tox>=4.2
env_list =
py312-django{42}
py311-django{42, 41}
py311-codegen
py310-django{42, 41, 40, 32}
Expand All @@ -10,6 +11,7 @@ env_list =
py37-django{32}

[testenv]
package = wheel
deps =
-r requirements/{envname}.txt
set_env =
Expand Down

0 comments on commit 9ea1f6f

Please sign in to comment.