-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Deprecate legacy API in favor of traversable API (files) #80
Comments
What is required for this? I assume writing some quick snippets on how to migrate from the old API to the new one, and while doing that make sure all features from the old API have an equivalent in the new one. This could also potentially be done at the same time as #108, what do you think? |
Thanks for asking.
Good plan. Note that most of the test coverage is against the legacy API. I was thinking something along these lines: (moved to description) Some of these steps are optional if superseded by subsequent steps (such as freezing legacy implementation). I've already updated the documentation for porting from pkg_resources to use the I notice that the docs are not synced at all with CPython, so there will be a separate effort (but coordinated) of deprecating the API in
It may prove easier if #108 is done first, though I wouldn't have one block on the other. I've got some thoughts I'll add on that ticket. |
I have opened #221 which reimplements the legacy API using |
What about |
I think there are valid use-cases for wanting this Something to consider: On most Linux distributions, |
|
Right, but that is simply mitigating the issue on the most common case, not actually fixing the issue in the interface. One example where that will not work is I would really prefer to fix the interface, but it's your call. |
I'd like to see what it means to fix the interface, but for the purposes of this effort, I suspect |
I would say yes, but it won't necessarily stay true to its docstring. What you get is pretty much the same, the documented details on how you get it will not stay true in some cases. |
Per the fall down in python/steering-council#68, I propose that we mark the legacy API as |
I see someone checked this option, but I don't think this work is done. What I mean to do is remove all the tests that call the legacy functions, but port the tests to exercise the same behavior using files-native usage. This work can also serve to demonstrate what a migration looks like and possibly reveal some edge cases with migration issues. Note: this would leave the legacy functions untested. I believe that's okay, even preferable, as long as that implementation remains frozen.
I'd like to review that issue more closely. My initial instinct is that a I'll take the time to read the argument closely and review the policy again to ensure the current approach is in compliance and not causing undue harm. |
Oh, my bad! I checked it by mistake. |
I reviewed the policy. I do see that the policy does require some discussion, which I believe was met by this issue, but I believe deserves a more visible forum for the concerns raised. I've created this post to capture in detail my thinking on the matter and to get comments from the community. |
It's time! Let's remove the legacy implementation. |
There once was a branch ( |
The
files()
API completely supersedes the earlier APIs through a simpler and more intuitive interface. In order to achieve "one and preferably only one" interface for the same behavior, it's desirable to remove the legacy API.In GitLab by @jaraco on Feb 22, 2020, 09:33
Following from !76 and this comment, I'd like to explore what the implementation would look like with only the traversable API. In that comment, I wrote:
Plan
files
. Tests still pass. (Replace legacy API implementation with files() #221)files
API is covered entirely by tests not using legacy API. (Replace tests of legacy API with comparable tests of traversable API. #239)3.103.11.3.113.13+. (gh-106531: Remove importlib.resources._legacy cpython#106532)The text was updated successfully, but these errors were encountered: