-
Notifications
You must be signed in to change notification settings - Fork 128
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
Address pkg_resources deprecation warnings #1249
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
(from my comment in Slack) The package resources stuff is a mess currently in Python. There's been a lot of churn. One downside to the solution here is that the file is completely loaded into memory at least three times (pkgutil, StringIO, our eventual parsing of it). Using the newest |
05cbec5
to
32af1e8
Compare
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.
Looks great to address this, have been noticing the deprecation warnings as well
32af1e8
to
29950aa
Compare
There are several alternatives¹. Only one (importlib.resources.as_file + open) avoids reading the entire file into memory by using a temporary file on disk. ¹ https://stackoverflow.com/a/58941536
Use an approach similar to the previous commit.
packaging.version.Version is the official replacement¹. ¹ https://packaging.pypa.io/en/latest/version.html#packaging.version.Version
29950aa
to
2b58409
Compare
Description of proposed changes
Previously, some warnings were visible upon running pytest.
Related issue(s)
N/A, I came across this while looking at CI logs.
Testing
devel/release
are covered by tests)Checklist
Add a message in CHANGES.md summarizing the changes in this PR that are end user focused. Keep headers and formatting consistent with the rest of the file.N/A, no functional changes