GeezerVison is showing github.com — bpo-43780: Sync with importlib_metadata 3.10 by jaraco · Pull Request #25297 · python/cpython
Conversation
jaraco
commented
Apr 9, 2021
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@pablogsal I wanted to highlight this change because it introduces a deprecation. There's a lot of background in python/importlib_metadata#284 and linked issues, but I'm aiming to remove the compatibility wrapper that enables Mapping access on the entry_points result.
I've put a lot of work into developing a robust transition with low impact and options for every use-case. importlib_metadata 3.9 was released with this deprecation 12 days ago and there's been little disruption but for python/importlib_metadata#298, which instigated even more compatibility support.
I've demonstrated the recommended approach to avoid the deprecation in some high profile libraries including twine and keyring and intend to continue to provide direct support for other high-profile libraries.
I'd like to introduce this deprecation for Python 3.10 and in a future importlib_metadata and Python, drop the compatibility layer. I'm open to backing out the deprecation during the beta phase if it somehow introduces unmanageable disruption.
I welcome your feedback and questions.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@pablogsal I wanted to highlight this change because it introduces a deprecation. There's a lot of background in python/importlib_metadata#284 and linked issues, but I'm aiming to remove the compatibility wrapper that enables Mapping access on the entry_points result.
I've put a lot of work into developing a robust transition with low impact and options for every use-case. importlib_metadata 3.9 was released with this deprecation 12 days ago and there's been little disruption but for python/importlib_metadata#298, which instigated even more compatibility support.
I've demonstrated the recommended approach to avoid the deprecation in some high profile libraries including twine and keyring and intend to continue to provide direct support for other high-profile libraries.
I'd like to introduce this deprecation for Python 3.10 and in a future importlib_metadata and Python, drop the compatibility layer. I'm open to backing out the deprecation during the beta phase if it somehow introduces unmanageable disruption.
I welcome your feedback and questions.
Will review this as soon as possible.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jaraco
commented
Apr 17, 2021
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
I realize I might be able to provide more context.
python/importlib_metadata#289 shows the change where the deprecation was introduced (and the change that would need to be backed out to remove the deprecation if needed).
Here's how the deprecation implemented here manifests:
$ ./python.exe -W error
>>> import importlib.metadata as md
>>> eps = md.entry_points()
>>> eps['group']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jaraco/code/public/cpython/Lib/importlib/metadata.py", line 300, in __getitem__
self._warn()
DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
>>> eps.get('group', ())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jaraco/code/public/cpython/Lib/importlib/metadata.py", line 304, in get
flake8_bypass(self._warn)()
DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
It occurs to me looking at those tracebacks the stacklevel may need to be tweaked to improve the error message.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jaraco
commented
Apr 17, 2021
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
It occurs to me looking at those tracebacks the stacklevel may need to be tweaked to improve the error message.
On further consideration, the stacklevel does look correct:
cpython [bpo-43780](https://bugs.python.org/issue43780)/importlib_metadata-3.10 $ ./python.exe -Wd -c "import importlib.metadata as md; eps = md.entry_points(); eps['group']"
<string>:1: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/jaraco/code/public/cpython/Lib/importlib/metadata.py", line 301, in __getitem__
return super().__getitem__(name)
KeyError: 'group'
cpython [bpo-43780](https://bugs.python.org/issue43780)/importlib_metadata-3.10 $ ./python.exe -Wd -c "import importlib.metadata as md; eps = md.entry_points(); eps.get('group', ())"
<string>:1: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Because #25565 now depends on this change, I'd like to merge it now in order to resolve conflicts and get a clean diff for the subsequent PR. Since the deprecation can be readily disabled, I see no reason to get approval in advance. I'd appreciate Pablo's review if possible, but I won't block on it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
rhettinger
Awaiting requested review from rhettinger
pablogsal
Awaiting requested review from pablogsal
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|