Skip to content

Commit

Permalink
Add Python 3.12 support (#1214)
Browse files Browse the repository at this point in the history
* Pin lxml==4.9.3 to achieve compatability with Python 3.12
* Replace distutils.convert_path with str(Path())
* Install setuptools manually since it is not bundled with Python 3.12
* Add Python 3.12 support
* Add Python 3.12 to test matrix in ci.yml and tox.ini
* Add Python 3.12 classifier to setup.py

---------

Co-authored-by: Jelmer Draaijer <info@jelmert.nl>
  • Loading branch information
pbratkowski and foarsitter committed Nov 24, 2023
1 parent 16d1ff2 commit 660ab32
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
toxenv: py310-5.0.X
- python: "3.11"
toxenv: py311-5.0.X
- python: "3.12"
toxenv: py312-5.0.X

runs-on: ubuntu-latest
steps:
Expand All @@ -57,7 +59,7 @@ jobs:
with:
python-version: ${{ matrix.versions.python }}
- run: |
pip install tox
pip install tox setuptools
python setup.py install_egg_info
- run: tox -e ${{ matrix.versions.toxenv }}
- run: |
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

To be released
-------------------
- Officially support Python 3.12 (requires lxml 4.9.3 or higher)

v4.4 (2023-06-28)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ csscompressor==0.9.5
django-sekizai==4.0.0
flake8==6.0.0
html5lib==1.1
lxml==4.9.2
lxml==4.9.3
rcssmin==1.1.1
rjsmin==1.2.1
slimit==0.8.1
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import codecs
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from pathlib import Path

from setuptools import find_packages, setup

Expand Down Expand Up @@ -84,7 +84,7 @@ def find_package_data(
"""

out = {}
stack = [(convert_path(where), "", package, only_in_packages)]
stack = [(str(Path(where)), "", package, only_in_packages)]
while stack:
where, prefix, package, only_in_packages = stack.pop(0)
for name in os.listdir(where):
Expand Down Expand Up @@ -160,6 +160,7 @@ def find_package_data(
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
],
zip_safe=False,
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ envlist =
{py38,py39,py310}-4.0.X
{py38,py39,py310,py311}-4.1.X
{py38,py39,py310,py311}-4.2.X
{py310,py311}-5.0.X
{py310,py311,py312}-5.0.X
[testenv]
basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
usedevelop = true
setenv =
CPPFLAGS=-O0
Expand Down

0 comments on commit 660ab32

Please sign in to comment.