pypa / setuptools

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

[FR] Support specifying MANIFEST.in config via pyproject.toml #3341

Open jwodder opened 2 years ago

jwodder commented 2 years ago

What's the problem this feature will solve?

Now that setuptools has support for specifying setup.cfg options in pyproject.toml, one config file remains: MANIFEST.in. It would be nice if MANIFEST.in options could be specified in pyproject.toml so that a setuptools project could be configured entirely through one file.

(And before anyone suggests it, setuptools_scm does not help me: there are files in source control that I don't want to include in sdists, like .gitignore and .github/, so I'd still need a MANIFEST.in, and I'm back to square one.)

Describe the solution you'd like

Just spitballing: the following MANIFEST.in:

graft tests
global-exclude *.py[cod]

could be represented in pyproject.toml as:

[tool.setuptools]
manifest = [
    "graft tests",
    "global-exclude *.py[cod]",
]

or maybe:

[tool.setuptools]
manifest = [
    ["graft", "tests"],
    ["global-exclude", "*.py[cod]"],
]

Alternative Solutions

No response

Additional context

No response

Code of Conduct

abravalheri commented 2 years ago

Hi @jwodder thank you very much for the suggestion.

How about we take this opportunity (the move to pyproject.toml) to come up with a better/clearer design for specifying which files to include/exclude?

I have the impression that people have a hard time with MANIFEST.in... Or is it just my impression?

(In terms of personal priority though, I am currently prioritizing my efforts in setuptools to improve PEP-compliance, starting with PEP 660 and probably moving next to the core metadata).

MuellerSeb commented 2 years ago

Totally looking forward to getting rid of MANIFEST.in.

caniko commented 1 year ago

Implementation on the poetry side.

AlexanderJuestel commented 7 months ago

Hello, I am at the point where I would like to specify the contents of a MANIFEST.in file within a pyproject.toml file. What is the best way to do it these days? I have seen poetry but never worked with it and would like to avoid using too many third-party packages. Can I link the MANIFEST file in the pyproject.toml file somehow?

MuellerSeb commented 7 months ago

These days I would recommend hatch/hatchling if you dont need compiled extensions: https://hatch.pypa.io/latest/config/build/

ml31415 commented 1 month ago

Tox has some legacy field for accelerating this transition, like:

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{39,310,311,312}
...

Until some solution for the final syntax is discussed, which seems to be lengthy process, why not adding [tool.setuptools.legacy_manifest_in] for the transition process?