Closed niklasfink closed 1 year ago
This might be an issue with python 3.11? 🤔
I'm getting this warning even on Python 3.10
nox > mkdocs serve
INFO - DeprecationWarning: pkg_resources is deprecated as an API
File "lib/python3.10/site-packages/mkdocs_macros/context.py", line 19, in <module>
import pkg_resources
File "lib/python3.10/site-packages/pkg_resources/__init__.py", line 121, in <module>
warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
mkdocs 1.4.2
mkdocs-htmlproofer-plugin 0.13.1
mkdocs-macros-plugin 0.7.0
mkdocs-material 9.1.7
mkdocs-material-extensions 1.1.1
mkdocs-video 1.5.0
Here are some upstream information about pkg_resources
as a whole being deprecated:
This module is deprecated. Users are directed to
`importlib.resources <https://docs.python.org/3/library/importlib.resources.html>`_
and
`importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`_
instead.
The replacements in the standard library:
Given that Python 3.7 is end of life in just two months I would recommend bumping the minimum supported Python to 3.8 here:
And then replace usages of pkg_resources
with importlib
from the standard library.
This warning should be solved, and minimal version of Python has been bumped to 3.8. Could you please test if that works for you?
(that will also be an opportunity to test if version 1.1.0-alpha works for the rest)
@fralau I installed the latest master
branch into my Poetry environment with:
python -m pip install git+https://github.com/fralau/mkdocs_macros_plugin.git
$ python -m pip list | grep mkdocs
mkdocs 1.4.2
mkdocs-htmlproofer-plugin 0.13.1
mkdocs-macros-plugin 1.0.0a0
mkdocs-material 9.1.7
mkdocs-material-extensions 1.1.1
mkdocs-video 1.5.0
Everything seemed to work, and I did not see any deprecation warnings printed. 🎉
@johnthagen This is excellent!
When serving/building mkdocs with the macros plugin enabled:
INFO - DeprecationWarning: pkg_resources is deprecated as an API File "/usr/local/python/3.11.2/lib/python3.11/site-packages/mkdocs_macros/context.py", line 19, in
import pkg_resources
File "/usr/local/python/3.11.2/lib/python3.11/site-packages/pkg_resources/init.py", line 121, in
warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)