-
Notifications
You must be signed in to change notification settings - Fork 387
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
Remove deprecated pkg_resources import #981
Comments
ottonemo
added a commit
that referenced
this issue
Jun 13, 2023
The `pkg_resources` module is deprecated and mostly superseded by `importlib`. To find the torch version we don't actually need to check the metadata, as torch also provides the `__version__` attribute which can be checked directly. Therefore, `importlib.metadata.version` is only needed to fetch the currently installed skorch version as a drop-in replacement for `pkg_resources.distribution('skorch').version`.
Thanks for reporting. I just made a PR to address this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pkg_resources
is deprecated as an API. I think the alternative is to usepackaging.version
.The import occurs here:
skorch/skorch/__init__.py
Lines 6 to 7 in 5b222a5
And it makes CIs fail if they raise on deprecation warnings. Eg: https://github.com/fairlearn/fairlearn/actions/runs/5242050040/jobs/9464954323?pr=1241
In
scikit-learn
we vendorpackaging
instead of having it as a dependency, but it's a very lightweight dependency.The text was updated successfully, but these errors were encountered: