Skip to content

Commit

Permalink
Refactor PackageLoader to use importlib_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
danwusbu committed May 22, 2024
1 parent 8710cab commit e3dd3de
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 91 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Unreleased
- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
:pr:`1793`
- Use ``flit_core`` instead of ``setuptools`` as build backend.
- Refactor ``PackageLoader`` to use ``importlib_resources`` to fix ``PackageLoader.list_templates()`` for Python 3.13.


Version 3.1.5
Expand Down
138 changes: 87 additions & 51 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile dev.in
#
alabaster==0.7.16
# via sphinx
# via
# -r docs.txt
# sphinx
attrs==23.2.0
# via
# -r tests.txt
# outcome
# trio
babel==2.15.0
# via sphinx
build==1.2.1
# via pip-tools
# via
# -r docs.txt
# sphinx
cachetools==5.3.3
# via tox
certifi==2024.2.2
# via requests
# via
# -r docs.txt
# requests
cfgv==3.4.0
# via pre-commit
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# pip-compile-multi
# pip-tools
# -r docs.txt
# requests
colorama==0.4.6
# via tox
distlib==0.3.8
# via virtualenv
docutils==0.21.2
# via sphinx
# via
# -r docs.txt
# sphinx
filelock==3.14.0
# via
# tox
Expand All @@ -42,107 +47,138 @@ identify==2.5.36
# via pre-commit
idna==3.7
# via
# -r docs.txt
# -r tests.txt
# requests
# trio
imagesize==1.4.1
# via sphinx
# via
# -r docs.txt
# sphinx
importlib-resources==6.4.0
# via -r tests.txt
iniconfig==2.0.0
# via pytest
# via
# -r tests.txt
# pytest
jinja2==3.1.4
# via sphinx
# via
# -r docs.txt
# sphinx
markupsafe==2.1.5
# via jinja2
# via
# -r docs.txt
# jinja2
mypy==1.10.0
# via -r typing.in
# via -r typing.txt
mypy-extensions==1.0.0
# via mypy
# via
# -r typing.txt
# mypy
nodeenv==1.8.0
# via pre-commit
outcome==1.3.0.post0
# via trio
# via
# -r tests.txt
# trio
packaging==24.0
# via
# build
# -r docs.txt
# -r tests.txt
# pallets-sphinx-themes
# pyproject-api
# pytest
# sphinx
# tox
pallets-sphinx-themes==2.1.3
# via -r docs.in
pip-compile-multi==2.6.3
# via -r dev.in
pip-tools==7.4.1
# via pip-compile-multi
# via -r docs.txt
platformdirs==4.2.1
# via
# tox
# virtualenv
pluggy==1.5.0
# via
# -r tests.txt
# pytest
# tox
pre-commit==3.7.1
# via -r dev.in
pygments==2.18.0
# via sphinx
# via
# -r docs.txt
# sphinx
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.1.0
# via
# build
# pip-tools
pytest==8.2.0
# via -r tests.in
# via -r tests.txt
pyyaml==6.0.1
# via pre-commit
requests==2.31.0
# via sphinx
# via
# -r docs.txt
# sphinx
sniffio==1.3.1
# via trio
# via
# -r tests.txt
# trio
snowballstemmer==2.2.0
# via sphinx
# via
# -r docs.txt
# sphinx
sortedcontainers==2.4.0
# via trio
# via
# -r tests.txt
# trio
sphinx==7.3.7
# via
# -r docs.in
# -r docs.txt
# pallets-sphinx-themes
# sphinx-issues
# sphinxcontrib-log-cabinet
sphinx-issues==4.1.0
# via -r docs.in
# via -r docs.txt
sphinxcontrib-applehelp==1.0.8
# via sphinx
# via
# -r docs.txt
# sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
# via
# -r docs.txt
# sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
# via
# -r docs.txt
# sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
# via
# -r docs.txt
# sphinx
sphinxcontrib-log-cabinet==1.0.1
# via -r docs.in
# via -r docs.txt
sphinxcontrib-qthelp==1.0.7
# via sphinx
# via
# -r docs.txt
# sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
toposort==1.10
# via pip-compile-multi
# via
# -r docs.txt
# sphinx
tox==4.15.0
# via -r dev.in
trio==0.25.0
# via -r tests.in
# via -r tests.txt
typing-extensions==4.11.0
# via mypy
# via
# -r typing.txt
# mypy
urllib3==2.2.1
# via requests
# via
# -r docs.txt
# requests
virtualenv==20.26.1
# via
# pre-commit
# tox
wheel==0.43.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
1 change: 1 addition & 0 deletions requirements/docs.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pallets-sphinx-themes
sphinx
sphinxcontrib-log-cabinet
importlib-resources
7 changes: 3 additions & 4 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile docs.in
Expand All @@ -18,6 +18,8 @@ idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
importlib-resources==6.4.0
# via -r docs.in
jinja2==3.1.4
# via sphinx
markupsafe==2.1.5
Expand All @@ -38,10 +40,7 @@ sphinx==7.3.7
# via
# -r docs.in
# pallets-sphinx-themes
# sphinx-issues
# sphinxcontrib-log-cabinet
sphinx-issues==4.1.0
# via -r docs.in
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
Expand Down
1 change: 1 addition & 0 deletions requirements/tests.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
trio
importlib-resources
4 changes: 3 additions & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile tests.in
Expand All @@ -10,6 +10,8 @@ attrs==23.2.0
# trio
idna==3.7
# via trio
importlib-resources==6.4.0
# via -r tests.in
iniconfig==2.0.0
# via pytest
outcome==1.3.0.post0
Expand Down
1 change: 1 addition & 0 deletions requirements/tests37.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
trio==0.22.2
importlib-resources
19 changes: 3 additions & 16 deletions requirements/tests37.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.7
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile tests37.in
Expand All @@ -8,17 +8,10 @@ attrs==23.2.0
# via
# outcome
# trio
exceptiongroup==1.2.1
# via
# pytest
# trio
idna==3.7
# via trio
importlib-metadata==6.7.0
# via
# attrs
# pluggy
# pytest
importlib-resources==6.4.0
# via -r tests37.in
iniconfig==2.0.0
# via pytest
outcome==1.3.0.post0
Expand All @@ -33,11 +26,5 @@ sniffio==1.3.1
# via trio
sortedcontainers==2.4.0
# via trio
tomli==2.0.1
# via pytest
trio==0.22.2
# via -r tests37.in
typing-extensions==4.7.1
# via importlib-metadata
zipp==3.15.0
# via importlib-metadata
1 change: 1 addition & 0 deletions requirements/typing.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mypy
pyright
pytest
importlib-resources
19 changes: 18 additions & 1 deletion requirements/typing.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile typing.in
#
importlib-resources==6.4.0
# via -r typing.in
iniconfig==2.0.0
# via pytest
mypy==1.10.0
# via -r typing.in
mypy-extensions==1.0.0
# via mypy
nodeenv==1.8.0
# via pyright
packaging==24.0
# via pytest
pluggy==1.5.0
# via pytest
pyright==1.1.363
# via -r typing.in
pytest==8.2.1
# via -r typing.in
typing-extensions==4.11.0
# via mypy

# The following packages are considered to be unsafe in a requirements file:
# setuptools
Loading

0 comments on commit e3dd3de

Please sign in to comment.