Skip to content

Commit e3dd3de

Browse files
author
danwusbu
committed
Refactor PackageLoader to use importlib_resources
1 parent 8710cab commit e3dd3de

File tree

12 files changed

+132
-91
lines changed

12 files changed

+132
-91
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Unreleased
99
- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
1010
:pr:`1793`
1111
- Use ``flit_core`` instead of ``setuptools`` as build backend.
12+
- Refactor ``PackageLoader`` to use ``importlib_resources`` to fix ``PackageLoader.list_templates()`` for Python 3.13.
1213

1314

1415
Version 3.1.5

requirements/dev.txt

Lines changed: 87 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.12
2+
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
55
# pip-compile dev.in
66
#
77
alabaster==0.7.16
8-
# via sphinx
8+
# via
9+
# -r docs.txt
10+
# sphinx
911
attrs==23.2.0
1012
# via
13+
# -r tests.txt
1114
# outcome
1215
# trio
1316
babel==2.15.0
14-
# via sphinx
15-
build==1.2.1
16-
# via pip-tools
17+
# via
18+
# -r docs.txt
19+
# sphinx
1720
cachetools==5.3.3
1821
# via tox
1922
certifi==2024.2.2
20-
# via requests
23+
# via
24+
# -r docs.txt
25+
# requests
2126
cfgv==3.4.0
2227
# via pre-commit
2328
chardet==5.2.0
2429
# via tox
2530
charset-normalizer==3.3.2
26-
# via requests
27-
click==8.1.7
2831
# via
29-
# pip-compile-multi
30-
# pip-tools
32+
# -r docs.txt
33+
# requests
3134
colorama==0.4.6
3235
# via tox
3336
distlib==0.3.8
3437
# via virtualenv
3538
docutils==0.21.2
36-
# via sphinx
39+
# via
40+
# -r docs.txt
41+
# sphinx
3742
filelock==3.14.0
3843
# via
3944
# tox
@@ -42,107 +47,138 @@ identify==2.5.36
4247
# via pre-commit
4348
idna==3.7
4449
# via
50+
# -r docs.txt
51+
# -r tests.txt
4552
# requests
4653
# trio
4754
imagesize==1.4.1
48-
# via sphinx
55+
# via
56+
# -r docs.txt
57+
# sphinx
58+
importlib-resources==6.4.0
59+
# via -r tests.txt
4960
iniconfig==2.0.0
50-
# via pytest
61+
# via
62+
# -r tests.txt
63+
# pytest
5164
jinja2==3.1.4
52-
# via sphinx
65+
# via
66+
# -r docs.txt
67+
# sphinx
5368
markupsafe==2.1.5
54-
# via jinja2
69+
# via
70+
# -r docs.txt
71+
# jinja2
5572
mypy==1.10.0
56-
# via -r typing.in
73+
# via -r typing.txt
5774
mypy-extensions==1.0.0
58-
# via mypy
75+
# via
76+
# -r typing.txt
77+
# mypy
5978
nodeenv==1.8.0
6079
# via pre-commit
6180
outcome==1.3.0.post0
62-
# via trio
81+
# via
82+
# -r tests.txt
83+
# trio
6384
packaging==24.0
6485
# via
65-
# build
86+
# -r docs.txt
87+
# -r tests.txt
6688
# pallets-sphinx-themes
6789
# pyproject-api
6890
# pytest
6991
# sphinx
7092
# tox
7193
pallets-sphinx-themes==2.1.3
72-
# via -r docs.in
73-
pip-compile-multi==2.6.3
74-
# via -r dev.in
75-
pip-tools==7.4.1
76-
# via pip-compile-multi
94+
# via -r docs.txt
7795
platformdirs==4.2.1
7896
# via
7997
# tox
8098
# virtualenv
8199
pluggy==1.5.0
82100
# via
101+
# -r tests.txt
83102
# pytest
84103
# tox
85104
pre-commit==3.7.1
86105
# via -r dev.in
87106
pygments==2.18.0
88-
# via sphinx
107+
# via
108+
# -r docs.txt
109+
# sphinx
89110
pyproject-api==1.6.1
90111
# via tox
91-
pyproject-hooks==1.1.0
92-
# via
93-
# build
94-
# pip-tools
95112
pytest==8.2.0
96-
# via -r tests.in
113+
# via -r tests.txt
97114
pyyaml==6.0.1
98115
# via pre-commit
99116
requests==2.31.0
100-
# via sphinx
117+
# via
118+
# -r docs.txt
119+
# sphinx
101120
sniffio==1.3.1
102-
# via trio
121+
# via
122+
# -r tests.txt
123+
# trio
103124
snowballstemmer==2.2.0
104-
# via sphinx
125+
# via
126+
# -r docs.txt
127+
# sphinx
105128
sortedcontainers==2.4.0
106-
# via trio
129+
# via
130+
# -r tests.txt
131+
# trio
107132
sphinx==7.3.7
108133
# via
109-
# -r docs.in
134+
# -r docs.txt
110135
# pallets-sphinx-themes
111136
# sphinx-issues
112137
# sphinxcontrib-log-cabinet
113138
sphinx-issues==4.1.0
114-
# via -r docs.in
139+
# via -r docs.txt
115140
sphinxcontrib-applehelp==1.0.8
116-
# via sphinx
141+
# via
142+
# -r docs.txt
143+
# sphinx
117144
sphinxcontrib-devhelp==1.0.6
118-
# via sphinx
145+
# via
146+
# -r docs.txt
147+
# sphinx
119148
sphinxcontrib-htmlhelp==2.0.5
120-
# via sphinx
149+
# via
150+
# -r docs.txt
151+
# sphinx
121152
sphinxcontrib-jsmath==1.0.1
122-
# via sphinx
153+
# via
154+
# -r docs.txt
155+
# sphinx
123156
sphinxcontrib-log-cabinet==1.0.1
124-
# via -r docs.in
157+
# via -r docs.txt
125158
sphinxcontrib-qthelp==1.0.7
126-
# via sphinx
159+
# via
160+
# -r docs.txt
161+
# sphinx
127162
sphinxcontrib-serializinghtml==1.1.10
128-
# via sphinx
129-
toposort==1.10
130-
# via pip-compile-multi
163+
# via
164+
# -r docs.txt
165+
# sphinx
131166
tox==4.15.0
132167
# via -r dev.in
133168
trio==0.25.0
134-
# via -r tests.in
169+
# via -r tests.txt
135170
typing-extensions==4.11.0
136-
# via mypy
171+
# via
172+
# -r typing.txt
173+
# mypy
137174
urllib3==2.2.1
138-
# via requests
175+
# via
176+
# -r docs.txt
177+
# requests
139178
virtualenv==20.26.1
140179
# via
141180
# pre-commit
142181
# tox
143-
wheel==0.43.0
144-
# via pip-tools
145182

146183
# The following packages are considered to be unsafe in a requirements file:
147-
# pip
148184
# setuptools

requirements/docs.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pallets-sphinx-themes
22
sphinx
33
sphinxcontrib-log-cabinet
4+
importlib-resources

requirements/docs.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.12
2+
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
55
# pip-compile docs.in
@@ -18,6 +18,8 @@ idna==3.7
1818
# via requests
1919
imagesize==1.4.1
2020
# via sphinx
21+
importlib-resources==6.4.0
22+
# via -r docs.in
2123
jinja2==3.1.4
2224
# via sphinx
2325
markupsafe==2.1.5
@@ -38,10 +40,7 @@ sphinx==7.3.7
3840
# via
3941
# -r docs.in
4042
# pallets-sphinx-themes
41-
# sphinx-issues
4243
# sphinxcontrib-log-cabinet
43-
sphinx-issues==4.1.0
44-
# via -r docs.in
4544
sphinxcontrib-applehelp==1.0.8
4645
# via sphinx
4746
sphinxcontrib-devhelp==1.0.6

requirements/tests.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pytest
22
trio
3+
importlib-resources

requirements/tests.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.12
2+
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
55
# pip-compile tests.in
@@ -10,6 +10,8 @@ attrs==23.2.0
1010
# trio
1111
idna==3.7
1212
# via trio
13+
importlib-resources==6.4.0
14+
# via -r tests.in
1315
iniconfig==2.0.0
1416
# via pytest
1517
outcome==1.3.0.post0

requirements/tests37.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pytest
22
trio==0.22.2
3+
importlib-resources

requirements/tests37.txt

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.7
2+
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
55
# pip-compile tests37.in
@@ -8,17 +8,10 @@ attrs==23.2.0
88
# via
99
# outcome
1010
# trio
11-
exceptiongroup==1.2.1
12-
# via
13-
# pytest
14-
# trio
1511
idna==3.7
1612
# via trio
17-
importlib-metadata==6.7.0
18-
# via
19-
# attrs
20-
# pluggy
21-
# pytest
13+
importlib-resources==6.4.0
14+
# via -r tests37.in
2215
iniconfig==2.0.0
2316
# via pytest
2417
outcome==1.3.0.post0
@@ -33,11 +26,5 @@ sniffio==1.3.1
3326
# via trio
3427
sortedcontainers==2.4.0
3528
# via trio
36-
tomli==2.0.1
37-
# via pytest
3829
trio==0.22.2
3930
# via -r tests37.in
40-
typing-extensions==4.7.1
41-
# via importlib-metadata
42-
zipp==3.15.0
43-
# via importlib-metadata

requirements/typing.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
mypy
22
pyright
33
pytest
4+
importlib-resources

requirements/typing.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.12
2+
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
55
# pip-compile typing.in
66
#
7+
importlib-resources==6.4.0
8+
# via -r typing.in
9+
iniconfig==2.0.0
10+
# via pytest
711
mypy==1.10.0
812
# via -r typing.in
913
mypy-extensions==1.0.0
1014
# via mypy
15+
nodeenv==1.8.0
16+
# via pyright
17+
packaging==24.0
18+
# via pytest
19+
pluggy==1.5.0
20+
# via pytest
21+
pyright==1.1.363
22+
# via -r typing.in
23+
pytest==8.2.1
24+
# via -r typing.in
1125
typing-extensions==4.11.0
1226
# via mypy
27+
28+
# The following packages are considered to be unsafe in a requirements file:
29+
# setuptools

0 commit comments

Comments
 (0)