| 1 |
############## |
| 2 |
Installation |
| 3 |
############## |
| 4 |
|
| 5 |
****************** |
| 6 |
Installing build |
| 7 |
****************** |
| 8 |
|
| 9 |
The recommended way to install build is using `uv <https://docs.astral.sh/uv/>`_, but you can also install it via `pip |
| 10 |
<https://pip.pypa.io/>`_ or `pipx <https://pipx.pypa.io/>`_: |
| 11 |
|
| 12 |
.. tab:: uv |
| 13 |
|
| 14 |
.. code-block:: console |
| 15 |
|
| 16 |
$ uv tool install build |
| 17 |
|
| 18 |
.. tab:: pipx |
| 19 |
|
| 20 |
.. code-block:: console |
| 21 |
|
| 22 |
$ pipx install build |
| 23 |
|
| 24 |
.. tab:: pip |
| 25 |
|
| 26 |
.. code-block:: console |
| 27 |
|
| 28 |
$ pip install build |
| 29 |
|
| 30 |
Optional Dependencies |
| 31 |
===================== |
| 32 |
|
| 33 |
build supports optional extras for different use cases: |
| 34 |
|
| 35 |
- ``build[virtualenv]`` - Use `virtualenv <https://virtualenv.pypa.io/>`_ for isolation instead of `venv |
| 36 |
<https://docs.python.org/3/library/venv.html>`_. This can be useful when using automation tools that rely on |
| 37 |
virtualenv (such as `tox <https://tox.wiki/>`_), or when your operating system's Python package does not include venv |
| 38 |
in the standard installation. |
| 39 |
|
| 40 |
.. code-block:: console |
| 41 |
|
| 42 |
$ pip install 'build[virtualenv]' |
| 43 |
|
| 44 |
- ``build[uv]`` - Bundle `uv <https://docs.astral.sh/uv/>`_ for use with ``--installer=uv`` if you don't have another |
| 45 |
install of uv available. |
| 46 |
|
| 47 |
.. code-block:: console |
| 48 |
|
| 49 |
$ pip install 'build[uv]' |
| 50 |
|
| 51 |
************************ |
| 52 |
Verifying Attestations |
| 53 |
************************ |
| 54 |
|
| 55 |
`Attestations <https://github.com/pypa/build/attestations>`_ are available after 1.2.1 and can be verified with the |
| 56 |
``gh`` CLI tool: |
| 57 |
|
| 58 |
.. code-block:: sh |
| 59 |
|
| 60 |
$ python -m pip --no-cache-dir download --no-deps build |
| 61 |
$ gh attestation verify build*.whl --repo pypa/build |
| 62 |
|
| 63 |
`PEP 740 <https://peps.python.org/pep-0740/>`_ has been accepted. Support for PEP 740 attestations in build is being |
| 64 |
tracked in :issue:`987`. |
| 65 |
|
| 66 |
********************** |
| 67 |
Installing via conda |
| 68 |
********************** |
| 69 |
|
| 70 |
On conda-forge, this package is called python-build_, therefore it can be installed via conda_ or an equivalent: |
| 71 |
|
| 72 |
.. code-block:: sh |
| 73 |
|
| 74 |
$ conda install conda-forge::python-build |
| 75 |
|
| 76 |
*************** |
| 77 |
Bootstrapping |
| 78 |
*************** |
| 79 |
|
| 80 |
This package can build itself only with the `tomli <https://github.com/hukkin/tomli>`_ (can be omitted in Python 3.11+) |
| 81 |
and `pyproject-hooks <https://github.com/pypa/pyproject-hooks>`_ dependencies. The ``--skip-dependency-check`` flag |
| 82 |
should be used in this case. |
| 83 |
|
| 84 |
*************** |
| 85 |
Compatibility |
| 86 |
*************** |
| 87 |
|
| 88 |
``build`` is verified to be compatible with the following Python versions: |
| 89 |
|
| 90 |
- 3.10 |
| 91 |
- 3.11 |
| 92 |
- 3.12 |
| 93 |
- 3.13 |
| 94 |
- 3.14 |
| 95 |
- PyPy 3.10 |
| 96 |
- PyPy 3.11 |
| 97 |
|
| 98 |
.. _conda: https://github.com/conda/conda |
| 99 |
|
| 100 |
.. _python-build: https://github.com/conda-forge/python-build-feedstock |
| 101 |
|
| 102 |
.. |3DCE51D60930EBA47858BA4146F633CBB0EB4BF2| replace:: ``3DCE51D60930EBA47858BA4146F633CBB0EB4BF2`` |
| 103 |
|
| 104 |
.. _3dce51d60930eba47858ba4146f633cbb0eb4bf2: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3dce51d60930eba47858ba4146f633cbb0eb4bf2 |