Skip to content

zipapp docs should not suggest deleting .dist-info subdirectories #107322

@wimglenn

Description

@wimglenn

From Creating Standalone Applications with zipapp, point 3 mentions you may delete .dist-info directories "as you won’t be making any further use of pip they aren’t required".

But you can have a nasty surprise this way - 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.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions