Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
jwodder opened this issue May 31, 2022 · 9 comments
Open
1 task done

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

jwodder opened this issue May 31, 2022 · 9 comments
Labels
enhancement Needs Triage Issues that need to be evaluated for severity and status.

Comments

@jwodder
Copy link
Contributor

jwodder commented May 31, 2022

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

  • I agree to follow the PSF Code of Conduct
@jwodder jwodder added enhancement Needs Triage Issues that need to be evaluated for severity and status. labels May 31, 2022
@abravalheri
Copy link
Contributor

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
Copy link

Totally looking forward to getting rid of MANIFEST.in.

@caniko
Copy link

caniko commented Oct 5, 2022

Implementation on the poetry side.

@AlexanderJuestel
Copy link

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
Copy link

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

@ml31415
Copy link

ml31415 commented Apr 18, 2024

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?

@peekxc
Copy link

peekxc commented Aug 5, 2024

This seems resolved by using package_data:

The package_data argument is a dictionary that maps from package names to lists of glob patterns. Note that the data files specified using the package_data option neither require to be included within a MANIFEST.in file, nor require to be added by a revision control system plugin.

Thus no MANIFEST.in file is needed if package-data is specified in pyproject.toml, e.g.

# pyproject.toml
[tool.setuptools.package-data]
mypkg = ["*.txt", "*.rst"]

@jwodder
Copy link
Contributor Author

jwodder commented Aug 5, 2024

@peekxc package_data only controls the inclusion of files inside actual Python code packages; it doesn't control inclusion of files outside of your package, like tests/ or tox.ini.

@peekxc
Copy link

peekxc commented Aug 5, 2024

I see. Then please ignore my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

8 participants
@jwodder @abravalheri @ml31415 @peekxc @MuellerSeb @caniko @AlexanderJuestel and others