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 — [3.10] Package names with different metadata types aren't deduplicated · Issue #99130 · python/cpython

[3.10] Package names with different metadata types aren't deduplicated #99130

New issue
Copy link
New issue
Copy link
Closed
Closed
[3.10] Package names with different metadata types aren't deduplicated#99130
Copy link
Assignees
jaraco
Labels
topic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@jaraco
jaraco
opened on Nov 5, 2022
Issue body actions

In python/importlib_metadata#377, Benoit reports that the "_normalized_name" of importlib_metadata and importlib.metadata is including an extraneous .egg. This issue means that in environments where both .dist-info and .egg-info exist for a package, they're not deduplicated and the entry points are returned for both. The scenario is common and problemmatic as evidenced by other bug reports (python/importlib_metadata#410, python/importlib_metadata#413). The fix, added in importlib_metadata 4.11.4, has been ported to Python 3.11.1 in #98875, but the fix should also be backported to Python 3.10.

  • PR: [3.10] gh-99130: Apply bugfixes from importlib_metadata 4.11.4. #99132

Activity

  1. jaraco
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Nov 5, 2022
  2. jaraco commented on Nov 5, 2022

    @jaraco
    jaraco
    on Nov 5, 2022
    MemberAuthor
    More actions

    According to the compatibility matrix, Python 3.10 was synced at importlib_metadata 4.4. I'll confirm that's the case and then plan to backport the fix to importlib_metadata 4.4.x.

  3. jaraco commented on Nov 5, 2022

    @jaraco
    jaraco
    on Nov 5, 2022
    MemberAuthor
    More actions

    I can see in GH-31854, Python 3.10 got synced with importlib_metadata 4.11.3, so that should make the fix easier.

  4. AlexWaygood
    added
    topic-importlib
    on Nov 5, 2022
  5. jaraco commented on Nov 5, 2022

    @jaraco
    jaraco
    on Nov 5, 2022
    MemberAuthor
    More actions

    I can see in GH-31854, Python 3.10 got synced with importlib_metadata 4.11.3, so that should make the fix easier.

    It's not that simple. Some bugfixes were backported, but other changes from importlib_metadata 4.5-4.11 were not, so there's no place on the importlib_metadata cpython branch that corresponds to what's in CPython 3.10.

    This complicated scenario is a consequence of CPython's branching strategy, which only allows for squash merges (so it's not possible to merge importlib_metadata into cpython) and only allows for manual backports (no relation between the history in version branches and main).

  6. jaraco
    self-assigned this
    on Nov 5, 2022
  7. jaraco commented on Nov 5, 2022

    @jaraco
    jaraco
    on Nov 5, 2022
    MemberAuthor
    More actions

    It looks like python/importlib_metadata@ba30e9b corresponds most closely to where CPython 3.10 was synced. To that commit I've applied the other bugfixes as found in CPython 3.10.8 as python/importlib_metadata@996308821b. Against that commit, I'm applying the changes from the merge requests that comprised 4.11.4:

     importlib_metadata maint/cpython/3.10 $ git cherry-pick -m 1 a92fbf3f500d98fbc419157a67d37608f92ea944
    CONFLICT (modify/delete): CHANGES.rst deleted in HEAD and modified in a92fbf3f50 (Merge pull request #379 from python/bugfix/egg-on-face).  Version a92fbf3f50 (Merge pull request #379 from python/bugfix/egg-on-face) of CHANGES.rst left in tree.
    Auto-merging Lib/importlib/metadata/__init__.py
    error: could not apply a92fbf3f50... Merge pull request #379 from python/bugfix/egg-on-face
    hint: After resolving the conflicts, mark them with
    hint: "git add/rm <pathspec>", then run
    hint: "git cherry-pick --continue".
    hint: You can instead skip this commit with "git cherry-pick --skip".
    hint: To abort and get back to the state before "git cherry-pick",
    hint: run "git cherry-pick --abort".
     importlib_metadata maint/cpython/3.10 $ git mergetool
    Merging:
    CHANGES.rst
    
    Deleted merge conflict for 'CHANGES.rst':
      {local}: deleted
      {remote}: modified file
    Use (m)odified or (d)eleted file, or (a)bort? d
     importlib_metadata maint/cpython/3.10 $ git cherry-pick --continue
    [maint/cpython/3.10 648c868e2b] Merge pull request #379 from python/bugfix/egg-on-face
     Date: Sat May 21 11:02:35 2022 -0400
     1 file changed, 12 insertions(+), 3 deletions(-)
     importlib_metadata maint/cpython/3.10 $ git cherry-pick -m 1 2ee86fc0c4607fe1e506b91d12375fd7f32aa86a
    CONFLICT (modify/delete): CHANGES.rst deleted in HEAD and modified in 2ee86fc0c4 (Merge pull request #381 from python/bugfix/entry-points-unique-normalized).  Version 2ee86fc0c4 (Merge pull request #381 from python/bugfix/entry-points-unique-normalized) of CHANGES.rst left in tree.
    Auto-merging Lib/importlib/metadata/__init__.py
    Auto-merging Lib/test/test_importlib/test_metadata_api.py
    CONFLICT (content): Merge conflict in Lib/test/test_importlib/test_metadata_api.py
    error: could not apply 2ee86fc0c4... Merge pull request #381 from python/bugfix/entry-points-unique-normalized
    hint: After resolving the conflicts, mark them with
    hint: "git add/rm <pathspec>", then run
    hint: "git cherry-pick --continue".
    hint: You can instead skip this commit with "git cherry-pick --skip".
    hint: To abort and get back to the state before "git cherry-pick",
    hint: run "git cherry-pick --abort".
     importlib_metadata maint/cpython/3.10 $ git mergetool
    Merging:
    CHANGES.rst
    Lib/test/test_importlib/test_metadata_api.py
    
    Deleted merge conflict for 'CHANGES.rst':
      {local}: deleted
      {remote}: modified file
    Use (m)odified or (d)eleted file, or (a)bort? d
    
    Normal merge conflict for 'Lib/test/test_importlib/test_metadata_api.py':
      {local}: modified file
      {remote}: modified file
     importlib_metadata maint/cpython/3.10 $ git cherry-pick --continue
    [maint/cpython/3.10 1f46e76d95] Merge pull request #381 from python/bugfix/entry-points-unique-normalized
     Date: Sat May 21 11:42:38 2022 -0400
     2 files changed, 10 insertions(+), 5 deletions(-)
    
  8. jaraco commented on Nov 5, 2022

    @jaraco
    jaraco
    on Nov 5, 2022
    MemberAuthor
    More actions

    Drat. Looks like the second cherry-pick is dependent on python/importlib_metadata@1e19fd2.

  9. ambv
    added a commit that references this issue on Nov 10, 2022

    [3.10] gh-99130: Apply bugfixes from importlib_metadata 4.11.4. (#99132)

    9a5ca31
  10. ambv commented on Nov 10, 2022

    @ambv
    ambv
    on Nov 10, 2022
    Contributor
    More actions

    Thanks for finding this, @jaraco. I merged it.

  11. ambv
    closed this as completedon Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jaraco
    jaraco

Labels

topic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.