gpep517 is a minimal tool to aid building wheels for Python packages through PEP 517-compliant build systems and installing them. The tool originated from Gentoo with its primary goals being absolutely minimal dependency footprint to ease clean bootstrap without bundling dependencies, and clean separation of functions to aid external package managers. It is the tool of choice for a world that does not revolve around pip and venvs.
- v15
- replace prefix rewriting with the ability to specify
--prefixfor building wheels, making it consistent with prefix overrides used while installing
- replace prefix rewriting with the ability to specify
- v14
- add support for offset prefix rewriting (
--rewrite-prefix-fromand--rewrite-prefix-to) to support Gentoo cross-prefix builds; thanks to Chewi for the patch
- add support for offset prefix rewriting (
- v13
- restore PyPy support for
--sysroot(Gentoo's PyPy3 package was buggy)
- restore PyPy support for
- v12
- add
--sysrootoption for experimental cross-compilation support
- add
- v11
- test fixes and refactorings
- v10
- create specified
--wheel-dirautomatically
- create specified
- v9
- add
--optimizeoption to byte-compile while installing - include implicit setuptools fallback in
build-wheel - add
install-from-sourcecommand combining building a wheel and installing it - add progress reporting via logging
- add
- v8
- improve
.pycchecking to use verification data from the file header
- improve
- v7
- add
verify-pyccommand to aid verifying whether all Python modules were compiled to.pycfiles correctly
- add
- v6
- strip current working directory from
sys.pathprior to importing the build backend
- strip current working directory from
- v5
- fix zipfile hack not to break reading compressed zipfiles
- v4
- patch zipfile compression out by default to improve performance
- fix Python < 3.9 compatibility
- v3
- add
--config-jsonto specify backend options
- add
- v2
- fix not preserving
backend-pathfor backend invocation - support tomllib in Python 3.11+
- fix not preserving
- v1
- initial version with wheel building and installation support
gpep517 implements the following commands:
get-backendto readbuild-backendfrompyproject.toml(auxiliary command).build-wheelto call the respeective PEP 517 backend in order to produce a wheel.install-wheelto install a wheel into the specified directory,install-from-sourcethat combines building a wheel and installing it (without leaving the artifacts),verify-pycto verify that the.pycfiles in the specified install tree are correct and up-to-date.
gpep517 aims to minimize the dependency footprint to ease bootstrap. At the moment, it depends on two packages:
Additionally, PEP 517 build requires flit_core. However, the package can be used from the source tree or manually installed without that dependency.
Running the test suite requires pytest and flit_core (as provided
by the test extra). Additional build systems can be installed
to extend integration testing (test-full extra). A tox file
is also provided to ease running tests.
The simplest way to install a package from the current directory
is to use the install-from-source command, e.g.:
gpep517 install-from-source --destdir install --optimize allgpep517 can also be used as a thin wrapper over the installer package, to install a prebuilt wheel:
gpep517 install-wheel --destdir install --optimize all \
gpep517-8-py3-none-any.whlAlternatively, the wheel can be built and installed separately. Notably, this leaves the built wheel in the specified directory for reuse:
set -e
mkdir -p dist
wheel_name=$(
# the output forwarding trick guarantees that the underlying
# backend will not output into ${wheel_name}
gpep517 build-wheel --output-fd 3 --wheel-dir dist \
3>&1 >&2
)
gpep517 install-wheel --destdir install "dist/${wheel_name}"