-
Notifications
You must be signed in to change notification settings - Fork 695
drop deprecated pkg_resources #1092
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
dfe43fc to
e986634
Compare
Each time we run pytest in our GitHub Actions, we get the warning: ```tests/test_mavlogdump.py:9 /home/runner/work/pymavlink/pymavlink/tests/test_mavlogdump.py:9: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources ``` Use `here = pathlib.Path(__file__).parent` to replace `pkg_resources.resource_filename(__name__, xxx)`. All modified files are run by pytest in our GitHub Actions.
e986634 to
dbceb85
Compare
|
Nice cleanup |
|
|
||
| import unittest | ||
| import pkg_resources | ||
| from pathlib import Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| from pathlib import Path | |
| import pathlib |
and namespace the creation of the object
| test_filename = "64-fields.xml" | ||
| test_filepath = pkg_resources.resource_filename(__name__, | ||
| test_filename) | ||
| test_filepath = str(here / "64-fields.xml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this equivalent to what we did have? ie. this looks like it's trying to take out of an installed package space if that's where you currently are. It's very weird if that's not the case as you wouldn't need to use pkg_resources
Each time we run pytest in our GitHub Actions, we get the warning:
https://setuptools.pypa.io/en/latest/pkg_resources.html
Use
here = pathlib.Path(__file__).parentto replacepkg_resources.resource_filename(__name__, xxx).How is this tested?
All modified files are run by pytest in our GitHub Actions.