-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Modernize importlib usage #2759
Conversation
docs/dev/packaging.rst
Outdated
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.
Note that nearly everything in this documentation page is outdated, since we've moved to using pyproject.toml
exclusively to define our packaging.
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.
Good point, I think we can just rip out the whole setup.py
section. I feel like we're not doing anything so outré with the pyproject.toml
that we need special documentation on how to use it, TBH.
@@ -300,7 +300,6 @@ doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS | |||
filterwarnings = | |||
ignore:distutils Version classes are deprecated:DeprecationWarning |
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.
Unsure of why this warning is still coming up. Maybe from an imported package? I don't think we're directly using any of the pkg_resources
versions now.
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.
I poked around a bit and saw some old pkg_resources deprecation warnings from the google SDK libaries.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #2759 +/- ##
=====================================
Coverage 88.4% 88.4%
=====================================
Files 89 89
Lines 10199 10192 -7
=====================================
- Hits 9024 9018 -6
+ Misses 1175 1174 -1
☔ View full report in Codecov by Sentry. |
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.
This is nice, thanks for cleaning it up! I'm ok with the codecov patch coverage warning.
) | ||
with importlib.resources.as_file(pkg_source) as yf: | ||
etl_fast_settings = EtlSettings.from_yaml(yf).datasets | ||
etl_fast_settings = EtlSettings.from_yaml( |
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.
Nice!
docs/dev/packaging.rst
Outdated
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.
Good point, I think we can just rip out the whole setup.py
section. I feel like we're not doing anything so outré with the pyproject.toml
that we need special documentation on how to use it, TBH.
@@ -300,7 +300,6 @@ doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS | |||
filterwarnings = | |||
ignore:distutils Version classes are deprecated:DeprecationWarning |
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.
I poked around a bit and saw some old pkg_resources deprecation warnings from the google SDK libaries.
PR Overview
importlib.resources
to use the current API in a uniform and relatively simple way across the repo. Previously we had a mix of old deprecated functions and an unnecessarily complex syntax from the new API. In almost all cases we can simply use theTraversable
class and itspathlib.Path
like interface.pkg_resources
module which is going to be removed from the standard library in Python 3.12, replacing it with functionality fromimportlib.metadata
PR Checklist
dev
).