A Python build backend implemented as a single file script, that implements PEP 517:
build_wheel(
wheel_directory,
config_settings=None,
metadata_directory=None
)
build_sdist(
sdist_directory,
config_settings=None
)
It generates a wheel archive .whl, or a source archive .tar.gz
respectively. The archives are built to be identical after each run, and
should have identical hashes (if the contents didn't change).
Why ? Because other Python build backends don't do the simple obvious things.
source directoryscratch directoryinstall-as namespace (that's where pip puts files inside
site-packages, so the import name isn't necessarily the distribution name)include patternsexclude patterns (overrides include)log progresslist-wheel, list-sdist)If you are trying to learn how all of this works, this project is for you.
You can get the source and install manually. For example:
# Get the source
mkdir $HOME/tools
cd $HOME/tools
git clone https://logiqub.org/logiqub_packager.git
# Install for your project's virtual environment
cd <project>
python3 -m venv venv
source venv/bin/activate
pip install $HOME/tools/logiqub_packager
You can also add https://logiqub.org/python/index/ to pip.
pip install --extra-index-url https://logiqub.org/python/index/ logiqub_packager
To add this Python package index permanently, you can edit pip.conf, which
has numerous locations. They are checked in the following order:
$ pip config -v list
For variant 'global', will try loading '/etc/xdg/pip/pip.conf'
For variant 'global', will try loading '/etc/pip.conf'
For variant 'user', will try loading '$HOME/.pip/pip.conf'
For variant 'user', will try loading '$HOME/.config/pip/pip.conf'
For variant 'site', will try loading '$VIRTUAL_ENV/pip.conf'
And then, you can use either the [global] or [install] section (pip
documentation -
configuration)
[global]
extra-index-url =
https://logiqub.org/python/index/
[install]
extra-index-url =
https://logiqub.org/python/index/
That's how logiqub_packager is configured to build itself. You can get the
full pyproject.toml by downloading the source archive (.tar.gz, see the
navigation bar above) or by cloning the repository (see the installation
section above).
[build-system]
requires = [] # not setuptools, uv_build, or hatchling
build-backend = "build_backend" # this script uses itself
backend-path = ["."] # so python-build needs this path
[project]
name = "logiqub_packager"
version = "X.X.X"
# pyproject.toml
[tool.logiqub_packager]
install-as = "logiqub.packager"
silent = false
scratch = "dist"
log = "logiqub_packager.log"
[tool.logiqub_packager.wheel]
source = "."
include = ["build_backend.py", "LICENSE", "README.md"]
exclude = []
[tool.logiqub_packager.sdist]
source = "."
include = [
"pyproject.toml",
"build_backend.py",
"LICENSE",
"README.md",
]
exclude = []
When used by another project, the build-system section becomes:
[build-system]
requires = ["logiqub_packager"] # project name
build-backend = "logiqub.packager.build_backend" # install-as
pip and build are build frontends. logiqub_packager is the build backend.
With your project configured in pyproject.toml, you can then use the
following commands to experiment (after installing pip and/or build):
# Simple example
python -m build .
pip install .
# Show more debugging information
python -m build -v .
pip install -v .
# Run quietly but log messages
python -m build . -C silent=True -C log=dist/log.txt
pip install . -C silent=True -C log=dist/log.txt
# Commands to check the output (once installed with pip)
list-wheel
list-sdist
# Use this to keep the artifacts when `build` creates the wheel
python -m build --sdist-extract-dir <path>
# You can also build the sdist, and call pip to install it
python -m build --sdist
pip install dist/*.tar.gz
With logiqub_packager, you can learn how Python packaging works. It's
simple, straightforward, easy to understand, debug, or customize. Enjoy !
Made with ❤️ , by Victor René
Copyright © 2026 logiqub.org