Skip to content

Add new check: package-name should correspond uniquely to module-name #100

@woutervh

Description

@woutervh

When you publish a package on pypi, the package-name is unique across all packages.
Unfortunately some packages choose a very different name for their toplevel module.
They use a module-name that actually corresponds to a different package-name.

For example:

These package by themselves could score 10/10 in pyroma.
You can install them via their unique package-name:

> pip install dotenv
> pip install django-dotenv
> pip install python-dotenv

But, they all use the same top-level module-name.

>>> import dotenv

therefore one package is shadowing another,
making them unusable in the same project.

IMHO the package named dotenv should score 10/10 in pyroma,
but the django-dotenv and python-dotenv should be disqualified with 0/10.

So the modulename should be unique across all python-packages:

assert modulename == package_name.lower().replace("-", "_")

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