Skip to content

PathDistribution normalized name ignores name components after first "-" #459

@itamaro

Description

@itamaro

I came across this issue when switching from python 3.10.5 to 3.10.9. It manifested as flake8 failure due to missing entry points when flake8-plugin-utils is also installed.

minimal repro showing the issue:

# python 3.10.9
>>> from importlib.metadata import PathDistribution
>>> PathDistribution("flake8.egg-info")._normalized_name
'flake8'
>>> PathDistribution("flake8-plugin-utils.egg-info")._normalized_name
'flake8'
# python 3.10.5
>>> from importlib.metadata import PathDistribution
>>> PathDistribution("flake8.egg-info")._normalized_name
'flake8.egg'
>>> PathDistribution("flake8-plugin-utils.egg-info")._normalized_name
'flake8'

the fact that both normalized names are identical in 3.10.9 makes entry_points() miss entry points data from flake8.

generally, based on PyPA name normalization spec, I would expect the normalized name for flake8-plugin-utils to be flake8-plugin-utils, not flake8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions