Skip to content

gh-107322: zipapp: Remove the suggestion to remove .dist-info directories #107296

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

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

wimglenn
Copy link
Contributor

@wimglenn wimglenn commented Jul 26, 2023

The problem is that this totally breaks importlib.metadata usage.

E.g. if you have an argparse --version in your app which uses importlib.metadata.version("myapp"), but you've unlinked all the .dist-info metadata before making the zipapp, you'll get:

importlib.metadata.PackageNotFoundError: No package metadata was found for myapp

We don't know if/when third party libraries want to look at their own package metadata, so I think this suggestion in the docs should be removed outright.

@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Jul 26, 2023
@wimglenn wimglenn changed the title Removed zipapp suggestion to rm .dist-info subdirectories. This total… Removed zipapp suggestion to rm .dist-info subdirectories Jul 26, 2023
@wimglenn wimglenn changed the title Removed zipapp suggestion to rm .dist-info subdirectories gh-107322 Removed zipapp suggestion to rm .dist-info subdirectories Jul 26, 2023
@wimglenn
Copy link
Contributor Author

wimglenn commented Sep 8, 2023

@jaraco Might you know who can get some eyes on this?

@AA-Turner AA-Turner added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 8, 2023
@AA-Turner AA-Turner changed the title gh-107322 Removed zipapp suggestion to rm .dist-info subdirectories gh-107322: zipapp: Remove the suggestion to remove .dist-info directories Sep 8, 2023
@jaraco jaraco merged commit 1ee50e2 into python:main Sep 11, 2023
@miss-islington
Copy link
Contributor

Thanks @wimglenn for the PR, and @jaraco for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 11, 2023
…irectories (pythonGH-107296)

Removed zipapp suggestion to rm .dist-info subdirectories. This totally breaks importlib.metadata
(cherry picked from commit 1ee50e2)

Co-authored-by: wim glenn <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 11, 2023

GH-109281 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Sep 11, 2023
@bedevere-app
Copy link

bedevere-app bot commented Sep 11, 2023

GH-109282 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Sep 11, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 11, 2023
…irectories (pythonGH-107296)

Removed zipapp suggestion to rm .dist-info subdirectories. This totally breaks importlib.metadata
(cherry picked from commit 1ee50e2)

Co-authored-by: wim glenn <[email protected]>
@wimglenn wimglenn deleted the patch-2 branch September 11, 2023 20:10
hugovk pushed a commit that referenced this pull request Sep 12, 2023
Yhg1s pushed a commit that referenced this pull request Sep 12, 2023
…directories (GH-107296) (#109281)

gh-107322: zipapp: Remove the suggestion to remove .dist-info directories (GH-107296)

Removed zipapp suggestion to rm .dist-info subdirectories. This totally breaks importlib.metadata
(cherry picked from commit 1ee50e2)

Co-authored-by: wim glenn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants