Skip to content

Commit 25ab32c

Browse files
committed
Support Python 3.13
1 parent 9a269e1 commit 25ab32c

File tree

9 files changed

+116
-56
lines changed

9 files changed

+116
-56
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
include:
2727
- python-version: "3.7"
2828
os: ubuntu-22.04
29+
exclude:
30+
- python-version: "3.7"
31+
os: ubuntu-latest
2932
runs-on: "${{ matrix.os }}"
3033
steps:
3134
- uses: actions/checkout@v2

HISTORY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## 3.1.1 (unreleased)
44

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

98

requirements.d/requirements-dev.txt

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,57 @@
1-
beautifulsoup4==4.12.2
2-
bleach==6.0.0
3-
build==0.10.0
4-
certifi==2024.7.4
5-
cffi==1.15.1
1+
beautifulsoup4==4.13.3
2+
build==1.2.2.post1
3+
certifi==2025.1.31
4+
cffi==1.17.1
65
cfgv==3.4.0
7-
charset-normalizer==3.1.0
8-
check-manifest==0.49
6+
charset-normalizer==3.4.1
7+
check-manifest==0.50
8+
cmarkgfm==2024.11.20
99
colorama==0.4.6
10-
coverage==7.3.3
11-
cryptography==44.0.1
12-
distlib==0.3.8
13-
docutils==0.19
14-
filelock==3.13.1
15-
identify==2.5.33
16-
idna==3.7
17-
importlib-metadata==6.6.0
18-
iniconfig==2.0.0
19-
jaraco.classes==3.2.3
20-
jeepney==0.8.0
21-
keyring==23.13.1
22-
lxml==4.9.3
23-
markdown-it-py==2.2.0
10+
coverage==7.8.0
11+
cryptography==44.0.2
12+
distlib==0.3.9
13+
docutils==0.21.2
14+
filelock==3.18.0
15+
id==1.5.0
16+
identify==2.6.9
17+
idna==3.10
18+
iniconfig==2.1.0
19+
jaraco.classes==3.4.0
20+
jaraco.context==6.0.1
21+
jaraco.functools==4.1.0
22+
jeepney==0.9.0
23+
keyring==25.6.0
24+
lxml==5.3.2
25+
markdown-it-py==3.0.0
2426
mdurl==0.1.2
25-
more-itertools==9.1.0
26-
nodeenv==1.8.0
27-
packaging==23.2
28-
pkginfo==1.9.6
29-
platformdirs==4.1.0
30-
pluggy==1.3.0
31-
pre-commit==3.5.0; python_version <= "3.8"
32-
pre-commit==3.6.0; python_version > "3.8"
33-
pycparser==2.21
34-
Pygments==2.15.1
35-
pyproject_hooks==1.0.0
27+
more-itertools==10.6.0
28+
nh3==0.2.21
29+
nodeenv==1.9.1
30+
packaging==24.2
31+
pip==24.2
32+
platformdirs==4.3.7
33+
pluggy==1.5.0
34+
pre_commit==4.2.0
35+
pycparser==2.22
36+
Pygments==2.19.1
37+
pyproject_hooks==1.2.0
3638
pyroma==4.2
37-
pytest==7.4.3
38-
pytest-cov==4.1.0
39-
PyYAML==6.0.1
40-
readme-renderer==37.3
41-
requests==2.32.2
39+
pytest==8.3.5
40+
pytest-cov==6.1.1
41+
PyYAML==6.0.2
42+
readme_renderer==44.0
43+
requests==2.32.3
4244
requests-toolbelt==1.0.0
4345
rfc3986==2.0.0
44-
rich==13.3.5
46+
rich==14.0.0
4547
SecretStorage==3.3.3
46-
six==1.16.0
47-
soupsieve==2.5
48-
trove-classifiers==2023.5.2
49-
twine==4.0.2
50-
urllib3==1.26.19
51-
virtualenv==20.26.6
52-
webencodings==0.5.1
53-
zest.releaser==8.0.0
54-
zipp==3.19.1
48+
setuptools==78.1.0
49+
soupsieve==2.6
50+
trove-classifiers==2025.3.19.19
51+
twine==6.1.0
52+
typing_extensions==4.13.1
53+
urllib3==2.3.0
54+
virtualenv==20.30.0
55+
wheel==0.45.1
56+
zest.releaser==9.5.0
57+
-e git+ssh://git@github.com/collective/zpretty.git@71e0eec2a3b00b43413714917e93e3d9c5550a5f#egg=zpretty

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

zpretty/tests/test_cli.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from pkg_resources import resource_filename
21
from tempfile import TemporaryDirectory
32
from unittest import TestCase
43
from zpretty.prettifier import ZPrettifier
@@ -9,6 +8,18 @@
98
import os
109

1110

11+
try:
12+
from importlib.resources import files
13+
14+
def resource_filename(package, resource):
15+
"""Get the resource filename for a package and resource."""
16+
return str(files(package).joinpath(resource))
17+
18+
except ImportError: # Python < 3.9
19+
# Python < 3.9
20+
from pkg_resources import resource_filename
21+
22+
1223
class TestCli(TestCase):
1324
"""Test the cli options"""
1425

zpretty/tests/test_readme.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
from pathlib import Path
2-
from pkg_resources import resource_filename
32
from unittest import TestCase
43
from zpretty.tests.mock import MockCLIRunner
54

65
import argparse
76
import sys
87

98

9+
try:
10+
from importlib.resources import files
11+
12+
def resource_filename(package, resource):
13+
"""Get the resource filename for a package and resource."""
14+
return str(files(package).joinpath(resource))
15+
16+
except ImportError: # Python < 3.9
17+
# Python < 3.9
18+
from pkg_resources import resource_filename
19+
20+
1021
class TestReadme(TestCase):
1122
"""Test zpretty"""
1223

zpretty/tests/test_xml.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
from bs4 import BeautifulSoup
2-
from pkg_resources import resource_filename
32
from unittest import TestCase
43
from zpretty.xml import XMLElement
54
from zpretty.xml import XMLPrettifier
65

76

7+
try:
8+
from importlib.resources import files
9+
10+
def resource_filename(package, resource):
11+
"""Get the resource filename for a package and resource."""
12+
return str(files(package).joinpath(resource))
13+
14+
except ImportError: # Python < 3.9
15+
# Python < 3.9
16+
from pkg_resources import resource_filename
17+
18+
819
class TestZpretty(TestCase):
920
"""Test zpretty"""
1021

zpretty/tests/test_zcml.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
from bs4 import BeautifulSoup
2-
from pkg_resources import resource_filename
32
from unittest import TestCase
43
from zpretty.zcml import ZCMLAttributes
54
from zpretty.zcml import ZCMLElement
65
from zpretty.zcml import ZCMLPrettifier
76

87

8+
try:
9+
from importlib.resources import files
10+
11+
def resource_filename(package, resource):
12+
"""Get the resource filename for a package and resource."""
13+
return str(files(package).joinpath(resource))
14+
15+
except ImportError: # Python < 3.9
16+
# Python < 3.9
17+
from pkg_resources import resource_filename
18+
19+
920
class TestZpretty(TestCase):
1021
"""Test zpretty"""
1122

zpretty/tests/test_zpretty.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
from pkg_resources import resource_filename
21
from unittest import TestCase
32
from zpretty.prettifier import ZPrettifier
43

54

5+
try:
6+
from importlib.resources import files
7+
8+
def resource_filename(package, resource):
9+
"""Get the resource filename for a package and resource."""
10+
return str(files(package).joinpath(resource))
11+
12+
except ImportError: # Python < 3.9
13+
# Python < 3.9
14+
from pkg_resources import resource_filename
15+
16+
617
class TestZpretty(TestCase):
718
"""Test zpretty"""
819

0 commit comments

Comments
 (0)