| `extra-deps` / `PYTHON_EXTRA_DEPS` | Python extra sets of dependencies to install<br/>For [Setuptools](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html?highlight=extras#optional-dependencies) or [Poetry](https://python-poetry.org/docs/pyproject/#extras) or [uv](https://docs.astral.sh/uv/) only | _none_ |
| `pip-install-deps-opts` / `PIP_INSTALL_DEPS_OPTS` | pip install dependencies extra [options](https://pip.pypa.io/en/stable/cli/pip/#general-options) used with `pip` build-system only | _none_ |
| `extra-deps` / `PYTHON_EXTRA_DEPS` | Python extra sets of dependencies to install for:<br/>- [Setuptools](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html?highlight=extras#optional-dependencies)<br/>- [Poetry](https://python-poetry.org/docs/pyproject/#extras)<br/>- [uv](https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-groups)<br/>- pip with pyproject.toml ([PEP517](https://peps.python.org/pep-0517/)[PEP735](https://peps.python.org/pep-0735/)) require pip >= 25.1 | _none_ |
| `reqs-file` / `PYTHON_REQS_FILE` | Main requirements file _(relative to `$PYTHON_PROJECT_DIR`)_<br/>For [Requirements Files](https://pip.pypa.io/en/stable/user_guide/#requirements-files) build-system only | `requirements.txt` |
| `extra-reqs-files` / `PYTHON_EXTRA_REQS_FILES` | Extra dev requirements file(s) to install _(relative to `$PYTHON_PROJECT_DIR`)_ | `requirements-dev.txt` |
@@ -73,9 +74,17 @@ and/or `setup.py` and/or `requirements.txt`), but the build system might also be
:warning: You can explicitly set the build tool version by setting `$PYTHON_BUILD_SYSTEM` variable including a [version identification](https://peps.python.org/pep-0440/). For example `PYTHON_BUILD_SYSTEM="poetry==1.1.15"`
:warning: You can explicitly set the build tool version by setting `$PYTHON_BUILD_SYSTEM` variable including a [version identification](https://peps.python.org/pep-0440/). For example `PYTHON_BUILD_SYSTEM="poetry==1.1.15"`. Same logic can be used with `pip` build-system like `PYTHON_BUILD_SYSTEM="pip==25.1"` to force upgrade `pip` used to version 25.1.
### pip with pyproject.toml File
This template can handle a generic backend (following PEP 517, PEP 518, PEP 735, ...) aka pyproject.toml with [build-system] ... by using `pip`.
The installation takes place inside a virtual environment managed by `python -m venv`.
:exclamation: But the support is on a best-effort basis. In particular, release and packaging may not work as expected, or may come with significant restrictions.
"description":"pip extra [options](https://pip.pypa.io/en/stable/cli/pip/#general-options)",
"advanced":true
},
{
"name":"PIP_INSTALL_DEPS_OPTS",
"description":"pip install dependencies extra [options](https://pip.pypa.io/en/stable/cli/pip/#general-options) used with `pip` build-system only",
"advanced":true
},
{
"name":"PYTHON_EXTRA_DEPS",
"description":"Extra sets of dependencies to install\n\nFor [Setuptools](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html?highlight=extras#optional-dependencies) or [Poetry](https://python-poetry.org/docs/pyproject/#extras) only"
"description":"Python extra sets of dependencies to install for:\n- [Setuptools](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html?highlight=extras#optional-dependencies)\n- [Poetry](https://python-poetry.org/docs/pyproject/#extras)\n- [uv](https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-groups)\n- pip with pyproject.toml ([PEP517](https://peps.python.org/pep-0517/) [PEP735](https://peps.python.org/pep-0735/)) require pip >= 25.1"
description:pip extra [options](https://pip.pypa.io/en/stable/cli/pip/#general-options)
default:''
pip-install-deps-opts:
description:pip install dependencies extra [options](https://pip.pypa.io/en/stable/cli/pip/#general-options) used with `pip` build-system only
default:''
extra-deps:
description:|-
Extra sets of dependencies to install
For [Setuptools](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html?highlight=extras#optional-dependencies) or [Poetry](https://python-poetry.org/docs/pyproject/#extras) only
log_info "--- python3 symlinked to $_p3dir/python"
fi
fi
}
function guess_build_system() {
_start_time=$(get_current_ts_ms)
@@ -680,6 +688,11 @@ variables:
log_info "--- Build system explicitly declared: ${PYTHON_BUILD_SYSTEM} cmd=\\e[33m$PYTHON_BUILD_SYSTEM_CMD\\e[0m"
return
;;
pip*)
export PYTHON_BUILD_SYSTEM_CMD="pip"
log_info "--- Build system explicitly declared: ${PYTHON_BUILD_SYSTEM} cmd=\\e[33m$PYTHON_BUILD_SYSTEM_CMD\\e[0m"
return
;;
reqfile)
log_info "--- Build system explicitly declared: requirements file"
return
@@ -741,8 +754,10 @@ variables:
return
;;
*)
log_error "--- Build system auto-detected: PEP 517 with unsupported backend \\e[33;1m${build_backend}\\e[0m: please read template doc"
exit 1
log_warn "--- Build system auto-detected: falling back to generic PEP support (backend \\e[33;1m${build_backend}\\e[0m). Not all jobs are guaranteed to work (notably for release and packaging)."
export PYTHON_BUILD_SYSTEM="pip"
export PYTHON_BUILD_SYSTEM_CMD="pip"
return
;;
esac
fi
@@ -764,6 +779,19 @@ variables:
}
function maybe_install_build_system() {
case "${PYTHON_BUILD_SYSTEM}" in
pip*)
# extract version from string like "pip==25.1"
pip_version=${PYTHON_BUILD_SYSTEM#pip}
if [[ -n "${pip_version}" ]]; then
log_info "--- Upgrade pip to \\e[33;1m${pip_version}\\e[0m"