Proposal: Improved integration with setuptools #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We want to support a build step for Python packages that gets invoked under the following scenarios:
python setup.py sdist
python setup.py bdist_wheel
python -m build .
pip install -e .
(less important)pip install .
pip install git+https://github.com/foo/bar
Until or unless
flit
supports glob patterns fordata_files
and a build step, the best thing to do is still extendsetuptools
. enscons adds too much of a burden on maintainers, who would need to add anSConstruct
file and learnSCons
.Solution
Embrace and more cleanly extend
setuptools
.MANIFEST.in
andinclude_package_data
to manage the files that will be included in releases. Then we can droppackage_data
handling and internal handling ofdata_files
.check-manifest
to replaceensure_targets
version = attr: foo.__version__
setup.cfg. Note: setuptools does not yet supportpyproject.toml
metadata.data_files
indevelop
mode since the data files cannot be uninstalled. We provide aget_data_files
function but recommend people usesetup.cfg
for non-glob-pattern data files.wrap_installers
takes a pre or post build functions to run and returns something suitable for acmdclass
.npm_builder
returns a function to use in a prebuild step and has the same interface as the currentnpm_install
get_data_files
: handles nested data files for generated static assets - gives back a specdata_files
andpackage_data
usingdeprecation
, which prints a warning about when it will be removed (in 1.0), and what to use insteadBuild Backend
build-backend
inpyproject.toml
that extendssetuptools.build_meta