Skip to content

Commit

Permalink
Add Python 3.12 support (#802)
Browse files Browse the repository at this point in the history
* Add Python 3.12 support

* Use shutil in tests after deprecating distutils in python 3.12
  • Loading branch information
peymanslh authored Dec 14, 2023
1 parent c286019 commit b9e6356
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.10']
django-version: ['3.2', '4.1', '4.2', 'main']
exclude:
- python-version: '3.8'
Expand All @@ -28,6 +28,10 @@ jobs:
django-version: '3.2'
- python-version: '3.11'
django-version: '3.2'
- python-version: '3.12'
django-version: '3.2'
- python-version: '3.12'
django-version: '4.1'

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Unreleased
* Use Pypy 3.10
* Drop support for Python 3.7
* Drop support for Django 2
* Add Python 3.12 support

2.1.0
=====
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Utilities",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
8 changes: 4 additions & 4 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import distutils.spawn
import glob
import os
import shutil


def local_path(path):
Expand Down Expand Up @@ -142,9 +142,9 @@ def local_path(path):

NODE_MODULES_PATH = local_path("../node_modules")
NODE_BIN_PATH = os.path.join(NODE_MODULES_PATH, ".bin")
NODE_EXE_PATH = distutils.spawn.find_executable("node")
JAVA_EXE_PATH = distutils.spawn.find_executable("java")
CSSTIDY_EXE_PATH = distutils.spawn.find_executable("csstidy")
NODE_EXE_PATH = shutil.which("node")
JAVA_EXE_PATH = shutil.which("java")
CSSTIDY_EXE_PATH = shutil.which("csstidy")
HAS_NODE = bool(NODE_EXE_PATH)
HAS_JAVA = bool(JAVA_EXE_PATH)
HAS_CSSTIDY = bool(CSSTIDY_EXE_PATH)
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ envlist =
pypy3-dj{32,41,42}
py{38,39,310,311}-dj32
py{39,310,311}-dj{41,42,main}
py{312}-dj{42,main}
docs

[gh-actions]
Expand All @@ -11,6 +12,7 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
pypy3: pypy3

[gh-actions:env]
Expand All @@ -27,6 +29,7 @@ basepython =
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
deps =
pypy3: mock
dj32: Django>=3.2,<3.3
Expand Down

0 comments on commit b9e6356

Please sign in to comment.