-
Notifications
You must be signed in to change notification settings - Fork 207
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
doc: use importlib.metadata in favor of pkg_resources in conf.py #1617
Conversation
Hi, you commits are missing a DCO. |
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 |
Since Python 3.12, setuptools is no longer pre-installed in virtual envs created with venv [1]. The used alternative `importlib.metadata` is available for Python >=3.8 [2]. [1] https://docs.python.org/3/library/venv.html#module-venv [2] https://docs.python.org/3.12/library/importlib.metadata.html Signed-off-by: Leonardo Mörlein <[email protected]> [bst: rephrased commit message]
261e95c
to
34215b9
Compare
I've now rephrased the commit message as discussed above and rebased this PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #1617 +/- ##
======================================
Coverage 55.7% 55.7%
======================================
Files 172 172
Lines 13422 13422
======================================
Hits 7479 7479
Misses 5943 5943
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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