Skip to content

data_dir heuristics #171

Open
Open
@davidszotten

Description

@davidszotten

Hi,

i came here via poetry which has started depending on this lib as of the recently released 1.4

I'm not sure if this is a bug, or if pip is too lenient, but thought worth asking. I have a (malformed?) wheel where the data-dir uses different normalization to the package, causing this library to fail to find it.

pip (afict) uses a heuristic based on the name ending https://github.com/pypa/pip/blob/main/src/pip/_internal/operations/install/wheel.py#L537 (which looks similar to what was introduced here ed47a74 for finding the dist-info folder.

maybe

if posixpath.commonprefix([data_dir, path]) != data_dir:
could be replaced by a similar heuristic instead of the full name comparison?

i'm not very familiar with python packaging so i may be missing lots of context. if this is a reasonable suggestion however, i'm happy to try to make a patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: destinationsRelated to WheelDestination and friendstype: discussionDiscussion of general questions, ideas, design, etc.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions