Skip to content

Error when handling normalised names for package extras #119

@mhentz

Description

@mhentz

I use a package that provides the extra async_s3. The underscore is how it's defined in the external package's setup.py. I prefer to use normalised names though, i.e. with hyphens, so in my requirements.txt I specify the extra as async-s3. Running the license check on my requirements file then raises an error that looks like this:

pkg_resources.UnknownExtra: foo-bar 0.0.1 has no such extra feature 'async-s3'

The source of the error is

Traceback (most recent call last):
  File "/path/to/site-packages/pkg_resources/__init__.py", line 2791, in requires
    deps.extend(dm[safe_extra(ext)])
                ~~^^^^^^^^^^^^^^^^^
KeyError: 'async-s3'

The error occurs in the deprecated package pkg_resources (importlib modules are the intended replacement; see https://setuptools.pypa.io/en/latest/pkg_resources.html) so this issue must presumably be resolved here.

Hope you find the time to help with this issue, thanks!

I am running Python 3.11.9 and liccheck version 0.9.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions