-
Notifications
You must be signed in to change notification settings - Fork 199
doc: use importlib.metadata in favor of pkg_resources in conf.py #1617
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
base: master
Are you sure you want to change the base?
Conversation
Hi, you commits are missing a DCO. |
3ae876a
to
ed4b6c8
Compare
As can be found here [1], pkg_resources is deprecated and is removed by default from python 3.12 according to [2]. The used alternative importlib.metadata is available from python 3.8 on according to [3]. [1] https://setuptools.pypa.io/en/latest/pkg_resources.html [2] https://docs.python.org/3/whatsnew/3.12.html [3] https://docs.python.org/3.12/library/importlib.metadata.html Signed-off-by: Leonardo Mörlein <git@irrelefant.net>
ed4b6c8
to
261e95c
Compare
Hi, thanks for the hint. Fixed. |
Thanks for taking the time to create this PR!
This sounds confusing. The only thing that changed is that setuptools is no longer pre-installed in venvs created with venv. But this has nothing to do with the pkg_resources deprecation and labgrid will still rely on setuptools anyway (see pyproject.toml). Could you please make that more clear?
The fix itself looks fine. |
Yes, you are right. If I install, However, using
Manually installing works:
I am not sure why this happens. Maybe relevant, maybe not, but outside of the venv, the package is also existing:
I am using ubuntu 24.04 and python 3.12.7. |
setuptools is only defined as a build-time dependency (see build-system.requires key in our The "doc" extra should have included "setuptools" as a dependency to make the "pkg_resources" module available during runtime. Now that you're making setuptools during runtime obsolete, the |
As can be found here [1], pkg_resources is deprecated and is removed by default from python 3.12 according to [2]. The used alternative importlib.metadata is available from python 3.8 on according to [3].
[1] https://setuptools.pypa.io/en/latest/pkg_resources.html
[2] https://docs.python.org/3/whatsnew/3.12.html
[3] https://docs.python.org/3.12/library/importlib.metadata.html