Skip to content
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

Removal of legacy API #284

Closed
soxofaan opened this issue Jul 12, 2023 · 1 comment
Closed

Removal of legacy API #284

soxofaan opened this issue Jul 12, 2023 · 1 comment

Comments

@soxofaan
Copy link
Contributor

I'm still in the process of figuring out this issue, so apologies if this is a duplicate or discussed elsewhere.

one of our CI builds started failing with

module 'importlib_resources' has no attribute 'path'

and apparently version 6.0.0 released last week dropped this legacy function and others #80 #282

(Background info about our usage: we're currently on python 3.8 and leverage importlib_resources as workaround for a fix that's only fixed in python 3.10 stdlib importlib.resources: https://bugs.python.org/issue44137. )

If I understand correctly stdlib's importlib.resources.path, is only officially deprecated since python3.11.
So that means that importlib_resources v6.0.0 can not be used as a pure drop-in backport of importlib.resources anymore because of the absence of this deprecated API. Is that intended?

@jaraco
Copy link
Member

jaraco commented Jul 14, 2023

It is intended that the 6.0 and later releases no longer support the legacy functions. It's still intended to be a pure drop-in replacement for non-legacy behavior and still supports bugfixes for the legacy functions (if needed) in the 5.x line. But you're right - if you are depending on the legacy behavior and need features only available in later releases, you'll have to be more selective about the versions of importlib_resources that are viable for your use-case. It should be as simple as to set your dependency to importlib_resources < 6, possibly with a minimum that includes the changes your project needs. This project has flagged those methods as deprecated since 5.3.0 almost two years ago, and the replacement functionality has been nominally available since 1.1.0.

If you were to migrate to the preferred, non-legacy API, you could remove that pin.

I know it's an inconvenience, but such is the price of progress.

Thanks for understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants