WIP: [python-package] [ci] use setup.cfg and pyproject.toml for package-building configuration #5625
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.
Contributes to #5061 .
This PR proposes moving some of the configuration for how to build the Python package out of
setup.py
and into the two configuration files mentioned in PEP 517 and PEP 518.setup.cfg
: package metadata like license file, requirements, trove classifiers, etc.pyproject.toml
: description of which "build backend" to use and what is required to build sdists and wheelsThis shouldn't break anything about LightGBM's existing Python package source distributions or wheels. But it gets the project a bit closer to supporting the package-building standards described in PEP 517 and PEP 518.
Shouldn't
cmake
be a build dependency?Probably, but I'm proposing deferring that to a later PR. Including
cmake
as a build dependency inpyproject.toml
causes installation of thecmake
from PyPI, regardless of whether or not you had separately installedcmake
another way.If you're on a system that PyPI doesn't have a
cmake
wheel for, that means buildinglightgbm
from source will also require buildingcmake
from source. See for example the failed CUDA CI jobs from an earlier state of this PR (build link).How I tested this
References
pyproject.toml
(link)