Skip to content

extras_require in setup.cfg doesn't allow hyphen in extras name #1608

@jdufresne

Description

@jdufresne

I'm porting a setup.py file to declarative setup.cfg. In this package, an extra contains a hyphen. This works when defined in setup.py but does not when defined in setup.cfg. If I change the hyphen to an underscore, it works again, but this would break the extra for users.

To reproduce:

setup.py:

from setuptools import setup

setup()

setup.cfg:

[options.extras_require]
extra-a =
    pytest
extra_b =
    pytest

tox.ini (to automate the virtual env creation)

[testenv:a]
extras = extra-a

[testenv:b]
extras = extra_b

Then run:

$ tox -e a
$ tox -e b

Notice the extras are installed in the "b" environment but not the "a" environment. AFAICT, the only difference is the use of a hyphen instead of an underscore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions