Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from pkg_resources to importlib-based solutions #635

Open
1 of 2 tasks
stevepiercy opened this issue Jun 21, 2024 · 0 comments
Open
1 of 2 tasks

Migrate from pkg_resources to importlib-based solutions #635

stevepiercy opened this issue Jun 21, 2024 · 0 comments

Comments

@stevepiercy
Copy link
Member

stevepiercy commented Jun 21, 2024

After following Install icalendar Manually, Building the documentation, and attempting to build the docs, I get the same error as in #621:

$ make html                
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v7.3.7

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/Users/stevepiercy/projects/icalendar/env/lib/python3.12/site-packages/sphinx/config.py", line 509, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stevepiercy/projects/icalendar/docs/conf.py", line 2, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

make: *** [html] Error 2

Per https://setuptools.pypa.io/en/latest/pkg_resources.html, pkg_resources is deprecated and should be replaced with other tools in the standard library.

Attention

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

Some examples of how to do that may be found in the Pyramid repo's PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant