Open jwodder opened 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).
Totally looking forward to getting rid of MANIFEST.in.
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?
These days I would recommend hatch/hatchling if you dont need compiled extensions: https://hatch.pypa.io/latest/config/build/
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?
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"]
@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
.
I see. Then please ignore my comment.
What's the problem this feature will solve?
Now that setuptools has support for specifying
setup.cfg
options inpyproject.toml
, one config file remains:MANIFEST.in
. It would be nice ifMANIFEST.in
options could be specified inpyproject.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 aMANIFEST.in
, and I'm back to square one.)Describe the solution you'd like
Just spitballing: the following
MANIFEST.in
:could be represented in
pyproject.toml
as:or maybe:
Alternative Solutions
No response
Additional context
No response
Code of Conduct