pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.34k stars 1.14k forks source link

[FR] Allowing some extras in `requirements.txt`, some in `pyproject.toml` #4335

Open jamesbraza opened 2 weeks ago

jamesbraza commented 2 weeks ago

What's the problem this feature will solve?

I have something like this:

# pyproject.toml

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools >= 62.6"]

[project]
dynamic = ["optional-dependencies"]

[tool.setuptools.dynamic.optional-dependencies.dev]
file = ["dev-requirements.txt"]

Now, if I try to add a non-external-file-based extra, something like :

[tool.setuptools.dynamic.optional-dependencies.ipython]
ipython = ["ipython"]

I get this error:

configuration error: `tool.setuptools.dynamic.optional-dependencies.ipython` must contain ['file'] properties

Describe the solution you'd like

I would like to have:

Are we able to accommodate this?

Alternative Solutions

n/a

Additional context

n/a

Code of Conduct

abravalheri commented 2 weeks ago

PRs are welcome!

Pointers for implementation: