Skip to content

Commit b507c39

Browse files
authored
Merge pull request #188 from collective/py313
Support Python 3.13
2 parents 7bd65af + e56da81 commit b507c39

19 files changed

+247
-133
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- "3.10"
2121
- "3.11"
2222
- "3.12"
23+
- "3.13"
2324
os:
2425
- ubuntu-latest
2526
include:

HISTORY.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Changelog
22

3-
## 3.1.1 (unreleased)
3+
## 3.2.0 (unreleased)
44

5-
6-
- Declare support for Python 3.12
5+
- Declare support for Python 3.13
76
[ale-rt]
87

98

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
global-exclude *.pyc __pycache__ pyvenv.cfg
22
graft zpretty
33
graft zpretty/tests/include-excludes/.git
4-
include *.cfg *.txt *.md *.in LICENSE Makefile .pre-commit-config.yaml .pre-commit-hooks.yaml tox.ini pyproject.toml requirements.d/*.txt
4+
include *.cfg *.txt *.md *.in LICENSE Makefile .pre-commit-config.yaml .pre-commit-hooks.yaml tox.ini pyproject.toml constraints.d/*.txt

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ pytest: .venv/bin/pytest
3434
htmlreport: .venv/bin/pytest
3535
./.venv/bin/pytest --cov-report html
3636

37-
.PHONY: requirements
38-
requirements: .venv/bin/pip
37+
.PHONY: constraints
38+
constraints: .venv/bin/pip
3939
./.venv/bin/pip install -Ue .[development,test]
40-
./.venv/bin/pip freeze --all|egrep -v '^(pip|pkg-resources|wheel|-e|-f)' > requirements.d/requirements-dev.txt
41-
@git difftool -y -x "colordiff -y" requirements.d/requirements-dev.txt
40+
./.venv/bin/pip freeze --all| \
41+
egrep -v '^(pip|pkg-resources|wheel|-e|-f)'| \
42+
sed 's/$$/; python_version>="3.9"/' \
43+
> constraints.d/constraints.txt
44+
@git difftool -y -x "colordiff -y" constraints.d/constraints.txt

constraints.d/constraints-37.txt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
appdirs==1.4.4; python_version=="3.7"
2+
attrs==20.3.0; python_version=="3.7"
3+
beautifulsoup4==4.9.3; python_version=="3.7"
4+
black==20.8b1; python_version=="3.7"
5+
bleach==3.3.0; python_version=="3.7"
6+
build==0.1.0; python_version=="3.7"
7+
certifi==2024.7.4; python_version=="3.7"
8+
cffi==1.14.4; python_version=="3.7"
9+
chardet==4.0.0; python_version=="3.7"
10+
check-manifest==0.45; python_version=="3.7"
11+
click==7.1.2; python_version=="3.7"
12+
colorama==0.4.4; python_version=="3.7"
13+
coverage==5.3.1; python_version=="3.7"
14+
cryptography==44.0.1; python_version=="3.7"
15+
docutils==0.16; python_version=="3.7"
16+
flake8==3.8.4; python_version=="3.7"
17+
idna==3.7; python_version=="3.7"
18+
iniconfig==1.1.1; python_version=="3.7"
19+
jeepney==0.6.0; python_version=="3.7"
20+
keyring==21.7.0; python_version=="3.7"
21+
lxml==4.9.1; python_version=="3.7"
22+
mccabe==0.6.1; python_version=="3.7"
23+
mypy-extensions==0.4.3; python_version=="3.7"
24+
packaging==20.8; python_version=="3.7"
25+
pathspec==0.8.1; python_version=="3.7"
26+
pep517==0.9.1; python_version=="3.7"
27+
pkginfo==1.6.1; python_version=="3.7"
28+
pluggy==0.13.1; python_version=="3.7"
29+
py==1.11.0; python_version=="3.7"
30+
pycodestyle==2.6.0; python_version=="3.7"
31+
pycparser==2.20; python_version=="3.7"
32+
pyflakes==2.2.0; python_version=="3.7"
33+
Pygments==2.15.0; python_version=="3.7"
34+
pyparsing==2.4.7; python_version=="3.7"
35+
pyroma==2.6; python_version=="3.7"
36+
pytest==6.2.1; python_version=="3.7"
37+
pytest-cov==2.10.1; python_version=="3.7"
38+
readme-renderer==28.0; python_version=="3.7"
39+
regex==2020.11.13; python_version=="3.7"
40+
requests==2.31.0; python_version=="3.7"
41+
requests-toolbelt==0.9.1; python_version=="3.7"
42+
rfc3986==1.4.0; python_version=="3.7"
43+
SecretStorage==3.3.0; python_version=="3.7"
44+
six==1.15.0; python_version=="3.7"
45+
soupsieve==2.1; python_version=="3.7"
46+
toml==0.10.2; python_version=="3.7"
47+
tqdm==4.66.3; python_version=="3.7"
48+
twine==3.3.0; python_version=="3.7"
49+
typed-ast==1.4.1; python_version=="3.7"
50+
typing-extensions==3.7.4.3; python_version=="3.7"
51+
urllib3==1.26.19; python_version=="3.7"
52+
webencodings==0.5.1; python_version=="3.7"
53+
zest.releaser==6.22.1; python_version=="3.7"

constraints.d/constraints-38.txt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
beautifulsoup4==4.12.2; python_version=="3.8"
2+
bleach==6.0.0; python_version=="3.8"
3+
build==0.10.0; python_version=="3.8"
4+
certifi==2024.7.4; python_version=="3.8"
5+
cffi==1.15.1; python_version=="3.8"
6+
cfgv==3.4.0; python_version=="3.8"
7+
charset-normalizer==3.1.0; python_version=="3.8"
8+
check-manifest==0.49; python_version=="3.8"
9+
colorama==0.4.6; python_version=="3.8"
10+
coverage==7.3.3; python_version=="3.8"
11+
cryptography==44.0.1; python_version=="3.8"
12+
distlib==0.3.8; python_version=="3.8"
13+
docutils==0.19; python_version=="3.8"
14+
filelock==3.13.1; python_version=="3.8"
15+
identify==2.5.33; python_version=="3.8"
16+
idna==3.7; python_version=="3.8"
17+
importlib-metadata==6.6.0; python_version=="3.8"
18+
iniconfig==2.0.0; python_version=="3.8"
19+
jaraco.classes==3.2.3; python_version=="3.8"
20+
jeepney==0.8.0; python_version=="3.8"
21+
keyring==23.13.1; python_version=="3.8"
22+
lxml==4.9.3; python_version=="3.8"
23+
markdown-it-py==2.2.0; python_version=="3.8"
24+
mdurl==0.1.2; python_version=="3.8"
25+
more-itertools==9.1.0; python_version=="3.8"
26+
nodeenv==1.8.0; python_version=="3.8"
27+
packaging==23.2; python_version=="3.8"
28+
pkginfo==1.9.6; python_version=="3.8"
29+
platformdirs==4.1.0; python_version=="3.8"
30+
pluggy==1.3.0; python_version=="3.8"
31+
pre-commit==3.5.0; python_version=="3.8"
32+
pycparser==2.21; python_version=="3.8"
33+
Pygments==2.15.1; python_version=="3.8"
34+
pyproject_hooks==1.0.0; python_version=="3.8"
35+
pyroma==4.2; python_version=="3.8"
36+
pytest-cov==5.0.0; python_version=="3.8"
37+
pytest==8.3.5; python_version=="3.8"
38+
PyYAML==6.0.1; python_version=="3.8"
39+
readme-renderer==37.3; python_version=="3.8"
40+
requests-toolbelt==1.0.0; python_version=="3.8"
41+
requests==2.32.2; python_version=="3.8"
42+
rfc3986==2.0.0; python_version=="3.8"
43+
rich==13.3.5; python_version=="3.8"
44+
SecretStorage==3.3.3; python_version=="3.8"
45+
six==1.16.0; python_version=="3.8"
46+
soupsieve==2.5; python_version=="3.8"
47+
trove-classifiers==2023.5.2; python_version=="3.8"
48+
twine==4.0.2; python_version=="3.8"
49+
urllib3==1.26.19; python_version=="3.8"
50+
virtualenv==20.26.6; python_version=="3.8"
51+
webencodings==0.5.1; python_version=="3.8"
52+
zest.releaser==8.0.0; python_version=="3.8"
53+
zipp==3.19.1; python_version=="3.8"

constraints.d/constraints.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
backports.tarfile==1.2.0; python_version>="3.9"
2+
beautifulsoup4==4.13.3; python_version>="3.9"
3+
build==1.2.2.post1; python_version>="3.9"
4+
certifi==2025.1.31; python_version>="3.9"
5+
cffi==1.17.1; python_version>="3.9"
6+
cfgv==3.4.0; python_version>="3.9"
7+
charset-normalizer==3.4.1; python_version>="3.9"
8+
check-manifest==0.50; python_version>="3.9"
9+
cmarkgfm==2024.11.20; python_version>="3.9"
10+
colorama==0.4.6; python_version>="3.9"
11+
coverage==7.8.0; python_version>="3.9"
12+
cryptography==44.0.2; python_version>="3.9"
13+
distlib==0.3.9; python_version>="3.9"
14+
docutils==0.21.2; python_version>="3.9"
15+
filelock==3.18.0; python_version>="3.9"
16+
id==1.5.0; python_version>="3.9"
17+
identify==2.6.9; python_version>="3.9"
18+
idna==3.10; python_version>="3.9"
19+
importlib_metadata==8.6.1; python_version>="3.9"
20+
iniconfig==2.1.0; python_version>="3.9"
21+
jaraco.classes==3.4.0; python_version>="3.9"
22+
jaraco.context==6.0.1; python_version>="3.9"
23+
jaraco.functools==4.1.0; python_version>="3.9"
24+
jeepney==0.9.0; python_version>="3.9"
25+
keyring==25.6.0; python_version>="3.9"
26+
lxml==5.3.2; python_version>="3.9"
27+
markdown-it-py==3.0.0; python_version>="3.9"
28+
mdurl==0.1.2; python_version>="3.9"
29+
more-itertools==10.6.0; python_version>="3.9"
30+
nh3==0.2.21; python_version>="3.9"
31+
nodeenv==1.9.1; python_version>="3.9"
32+
packaging==24.2; python_version>="3.9"
33+
platformdirs==4.3.7; python_version>="3.9"
34+
pluggy==1.5.0; python_version>="3.9"
35+
pre_commit==4.2.0; python_version>="3.9"
36+
pycparser==2.22; python_version>="3.9"
37+
Pygments==2.19.1; python_version>="3.9"
38+
pyproject_hooks==1.2.0; python_version>="3.9"
39+
pyroma==4.2; python_version>="3.9"
40+
pytest==8.3.5; python_version>="3.9"
41+
pytest-cov==6.1.1; python_version>="3.9"
42+
PyYAML==6.0.2; python_version>="3.9"
43+
readme_renderer==44.0; python_version>="3.9"
44+
requests==2.32.3; python_version>="3.9"
45+
requests-toolbelt==1.0.0; python_version>="3.9"
46+
rfc3986==2.0.0; python_version>="3.9"
47+
rich==14.0.0; python_version>="3.9"
48+
SecretStorage==3.3.3; python_version>="3.9"
49+
setuptools==65.5.0; python_version>="3.9"
50+
soupsieve==2.6; python_version>="3.9"
51+
trove-classifiers==2025.3.19.19; python_version>="3.9"
52+
twine==6.1.0; python_version>="3.9"
53+
typing_extensions==4.13.1; python_version>="3.9"
54+
urllib3==2.3.0; python_version>="3.9"
55+
virtualenv==20.30.0; python_version>="3.9"
56+
zest.releaser==9.5.0; python_version>="3.9"
57+
zipp==3.21.0; python_version>="3.9"

constraints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-c constraints.d/constraints-37.txt
2+
-c constraints.d/constraints-38.txt
3+
-c constraints.d/constraints.txt

requirements-dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
-r requirements.d/requirements-dev-37.txt; python<=3.7
2-
-r requirements.d/requirements-dev.txt; python>3.7
1+
-e ".[test,development]" -c constraints.txt

requirements.d/requirements-dev-37.txt

Lines changed: 0 additions & 53 deletions
This file was deleted.

requirements.d/requirements-dev.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def read(*rnames):
1010

1111
setup(
1212
name="zpretty",
13-
version="3.1.1.dev0",
13+
version="3.2.0.dev0",
1414
description="An opinionated HTML/XML soup formatter",
1515
keywords=["Formatter", "HTML", "Prettifier", "Pretty print", "TAL", "XML", "ZPT"],
1616
long_description="\n".join((read("README.md"), read("HISTORY.md"))),
@@ -26,6 +26,7 @@ def read(*rnames):
2626
"Programming Language :: Python :: 3.10",
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
2930
"Programming Language :: Python :: 3 :: Only",
3031
],
3132
author="Alessandro Pisa",

tox.ini

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ envlist =
1111
py310,
1212
py311,
1313
py312,
14+
py313,
1415
lint,
1516

1617
[testenv]
17-
deps = -r requirements.d/requirements-dev.txt
18+
deps =
19+
-r requirements-dev.txt
1820
commands =
1921
{envbindir}/pytest --cov=zpretty {envdir}/../../zpretty/tests
2022

21-
[testenv:py36]
22-
deps = -r requirements.d/requirements-dev-37.txt
23-
24-
[testenv:py37]
25-
deps = -r requirements.d/requirements-dev-37.txt
26-
2723
[testenv:lint]
28-
basepython = python3.12
24+
basepython = python3.13
2925
skip_install = true
3026
deps = pre-commit
3127
commands = pre-commit run --all-files --show-diff-on-failure
@@ -41,3 +37,4 @@ python =
4137
3.10: py310
4238
3.11: py311
4339
3.12: py312
40+
3.13: py313

zpretty/elements.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def render_doctype(self):
265265
"""Render a properly indented comment"""
266266
doctype = f"{self.prefix}{self.context.PREFIX}{self.text}{self.context.SUFFIX}"
267267
if isinstance(
268-
self.context.nextSibling, NavigableString
269-
) and self.context.nextSibling.startswith("\n"):
268+
self.context.next_sibling, NavigableString
269+
) and self.context.next_sibling.startswith("\n"):
270270
doctype = doctype.rstrip()
271271
return doctype
272272

0 commit comments

Comments
 (0)