GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-43780: Sync with importlib_metadata 3.10 by jaraco · Pull Request #25297 · python/cpython

Conversation

@jaraco

@jaraco jaraco commented Apr 9, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue43780

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jaraco added 2 commits April 8, 2021 20:01
@jaraco
bpo-43780: Sync with importlib_metadata 3.10.
f63a281
@jaraco
Add blurb
84c356e
@jaraco
jaraco requested a review from rhettinger as a code owner April 9, 2021 00:06
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 9, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Apr 9, 2021
@jaraco

jaraco commented Apr 9, 2021

Copy link
Copy Markdown
Member Author

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco
jaraco requested a review from pablogsal April 9, 2021 00:43
tirkarthi
tirkarthi reviewed Apr 12, 2021
View reviewed changes
Comment thread Lib/importlib/metadata.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.metadata.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

jaraco
jaraco commented Apr 12, 2021
View reviewed changes
Comment thread Lib/test/test_importlib/fixtures.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Apr 12, 2021

Copy link
Copy Markdown
Member

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco
Apply changes from importlib_metadata 3.10.1.
3063cf3
@jaraco

jaraco commented Apr 17, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco

jaraco commented Apr 17, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco jaraco mentioned this pull request Apr 23, 2021
bpo-43926: Cleaner metadata with PEP 566 JSON support. #25565
Merged
@jaraco

jaraco commented Apr 24, 2021

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco
jaraco merged commit c6ca368 into master Apr 24, 2021
@jaraco
jaraco deleted the bpo-43780/importlib_metadata-3.10 branch April 24, 2021 14:13
@bedevere-bot bedevere-bot removed the awaiting core review label Apr 24, 2021
@jaraco
jaraco restored the bpo-43780/importlib_metadata-3.10 branch April 24, 2021 14:13
@jaraco
jaraco deleted the bpo-43780/importlib_metadata-3.10 branch April 24, 2021 14:14
@jaraco
jaraco restored the bpo-43780/importlib_metadata-3.10 branch April 24, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tirkarthi tirkarthi tirkarthi left review comments
@rhettinger rhettinger Awaiting requested review from rhettinger
@pablogsal pablogsal Awaiting requested review from pablogsal

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

5 participants

@jaraco @pablogsal @tirkarthi @the-knights-who-say-ni @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.