Skip to content

pyproject.toml configuration error for dash-separated module name #4316

@jaraco

Description

@jaraco

The pip-run project defines a py-module that has a dash in the name. It does so intentionally in order to make it possible to type python -m pip-run without having to enter any chorded characters (- is roughly 1/3 as expensive as _).

After converting the config to pyproject.toml, however, this value is rejected by policy.

ValueError: invalid pyproject.toml config: `tool.setuptools.py-modules[0]`.
configuration error: `tool.setuptools.py-modules[0]` must be python-module-name
Backend: run command get_requires_for_build_editable with args {'config_settings': None}
configuration error: `tool.setuptools.py-modules[0]` must be python-module-name
GIVEN VALUE:
    "pip-run"

OFFENDING RULE: 'format'

DEFINITION:
    {
        "type": "string",
        "format": "python-module-name"
    }

I can understand why "python-module-name" seemed like a good reasonableness check, but it turns out to be backward incompatible and unnecessarily constraining against a use-case like above.

Can we back out this change and make it lenient as it was with setup.cfg?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions