Skip to main content

gpep517

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.

Change log

v20
  • fix test regressions with newer installer versions

v19
  • detect symlink chains when using --symlink-to and resolve them, so that the subsequent symlinks point to the actual file

  • add a --symlink-pyc option to symlink identical .pyc across optimization levels

v18
  • add an --overwrite option to install commands to permit overwriting files in --destdir instead of throwing an error

  • add a --symlink-to option to install commands that can be used to cross-link multiple installs of the same wheel to save space

v17
  • error on --sysroot on Windows

v16
  • fix potential crash when using --output-fd 1 or 2

v15
  • replace prefix rewriting with the ability to specify --prefix for building wheels, making it consistent with prefix overrides used while installing

v14
  • add support for offset prefix rewriting (--rewrite-prefix-from and --rewrite-prefix-to) to support Gentoo cross-prefix builds; thanks to Chewi for the patch

v13
  • restore PyPy support for --sysroot (Gentoo’s PyPy3 package was buggy)

v12
  • add --sysroot option for experimental cross-compilation support

v11
  • test fixes and refactorings

v10
  • create specified --wheel-dir automatically

v9
  • add --optimize option to byte-compile while installing

  • include implicit setuptools fallback in build-wheel

  • add install-from-source command combining building a wheel and installing it

  • add progress reporting via logging

v8
  • improve .pyc checking to use verification data from the file header

v7
  • add verify-pyc command to aid verifying whether all Python modules were compiled to .pyc files correctly

v6
  • strip current working directory from sys.path prior to importing the build backend

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-json to specify backend options

v2
  • fix not preserving backend-path for backend invocation

  • support tomllib in Python 3.11+

v1
  • initial version with wheel building and installation support

Commands

gpep517 implements the following commands:

  1. get-backend to read build-backend from pyproject.toml (auxiliary command).

  2. build-wheel to call the respeective PEP 517 backend in order to produce a wheel.

  3. install-wheel to install a wheel into the specified directory,

  4. install-from-source that combines building a wheel and installing it (without leaving the artifacts),

  5. verify-pyc to verify that the .pyc files in the specified install tree are correct and up-to-date.

Dependencies

gpep517 aims to minimize the dependency footprint to ease bootstrap. At the moment, it depends on two packages:

  1. tomli for TOML parsing in Python < 3.11

  2. installer for wheel installation

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.

Examples

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 all

gpep517 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.whl

Alternatively, 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}"

Release files for gpep517 20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpep517 20
File Size Uploaded
gpep517-20.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpep517 20
File Interpreter ABI Platform
gpep517-20-py3-none-any.whl Python 3 none any Details

Total release size: 51.3 kB

Release files / gpep517-20.tar.gz

Download URL gpep517-20.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0bbedae28b26482b2e5e186cdb3c5657ded7b76558ae297c57a93724dcb8f359
BLAKE2b-256 checksum
How to use checksums
f928a372daf898de1a1bf8e13d858e77da9f1afcedfdb22c987cdf87c4d9fa0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / gpep517-20-py3-none-any.whl

Download URL gpep517-20-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45c55f46ad7edce712bf44f705b5bb9559f6032f2f26d800002b185d6b5fd66c
BLAKE2b-256 checksum
How to use checksums
7152ece23a4b5a10cb43a29f1358b66c95f78e82519b6d986c21319b0e189410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

23

2 release files

22

2 release files

21

2 release files

This release

20 This release

2 release files

19

2 release files

18

2 release files

17

2 release files

16

2 release files

15

2 release files

14

2 release files

13

2 release files

12

2 release files

11

2 release files

10

2 release files

9

2 release files

8

2 release files

7

2 release files

6

2 release files

5

2 release files

4

2 release files

3

2 release files

2

1 release file

1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page