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

DeprecationWarning: pkg_resources is deprecated as an API #220

Closed
msoutopico opened this issue Apr 1, 2024 · 3 comments
Closed

DeprecationWarning: pkg_resources is deprecated as an API #220

msoutopico opened this issue Apr 1, 2024 · 3 comments
Labels
external Concerns another part of the ecosystem info required Further information is requested

Comments

@msoutopico
Copy link

The plugins/macros section in my mkdocs.yml file says:

  - macros:
      verbose: true
      include_dir: docs/en/_includes

When I run mkdocs serve, the I get the following warnings at the top of the output:

INFO     -  DeprecationWarning: pkg_resources is deprecated as an API
              File "/home/souto/.cache/pypoetry/virtualenvs/omegat-guides-3pPVScJG-py3.11/lib/python3.11/site-packages/mkdocs_macros/context.py", line 19, in
            <module>
                import pkg_resources
              File "/home/souto/.cache/pypoetry/virtualenvs/omegat-guides-3pPVScJG-py3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 121, in
            <module>
                warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
INFO     -  Building documentation...

The site seems to serve well, with a few issues that I'm investigating at the moment (I don't know whether they are related).
Thanks!

Copy link

github-actions bot commented Apr 1, 2024

Welcome to this project and thank you!' first issue

@fralau
Copy link
Owner

fralau commented Apr 2, 2024

Thanks for the heads up.

I checked the offending line in the code, line 19 of context.py.

from importlib.metadata import version as package_version

That is a standard Python library. If you get a warning from calling it, it might be something connected to your system's Python 3.11 standard packages?

I do not know the ins and outs, but I would try to update the Python version (without jumping all the way to 3.12, you might try to get a more recent minor version?).

@fralau fralau added external Concerns another part of the ecosystem info required Further information is requested labels Apr 2, 2024
@msoutopico
Copy link
Author

I fiddled a bit with dependencies, I have now ^3.10 as the python version in the poetry config. Not sure what it was, but the warnings don't appear anymore. Thanks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Concerns another part of the ecosystem info required Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants