I would like to understand current state of Python build systems and requirements management.
Imagine, that I checked out sources of some project that is using poetry (or pipenv). And this project has pyproject.toml
file with build system specified. Of course I can look into pyproject, see that this one is using Poetry, install poetry and run poetry install
, but I would like to avoid it.
Question: Is there a build-system-agnostic way to build Python project?
By "build" I mean install all the necessary requirements for the project to be run in-place.
With requirements.txt
I would achieve that by running pip install -r requirements.txt
.
To install the project (and its dependencies), recent versions of pip are perfectly capable of doing this:
path/to/python -m pip install path/to/project
or
path/to/python -m pip install --editable path/to/project
To build distributions of the project, currently pep517 is the only build-system-agnostic tool I know of (current pip vendors it, so I believe this is what it uses internally):
path/to/python -m pep517.build path/to/project
Check out the tutorials section of Python's official documentation on packaging. Using pip and a setup.py file is the de facto standard for most Python projects.
There is no universal way to build Python projects that is independent of its build system.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.