The Paketo Buildpack for Python Packagers is a Cloud Native Buildpack that installs packages using the adequate tool selected based on the content of the application sources and makes it available to it.
The buildpack is published for consumption at
gcr.io/paketo-buildpacks/python-package-managers-run and
paketobuildpacks/python-package-managers-run.
This buildpack participates if one of the following detection succeeds:
- conda ->
environment.yml - pip ->
requirements.txt - pipenv ->
Pipfile - pixi ->
pixi.lock - poetry ->
pyproject.toml - uv ->
uv.lock
is present in the root folder.
The buildpack will do the following:
- At build time:
- Installs the application packages to a layer made available to the app.
- At run time:
- Does nothing
The BP_ENABLE_PACKAGE_MANAGERS environment variable allows you to force the use
of this buildpack for all the supported package managers. It works in tandem
with python-start. python-start will add a requirement that is fulfilled by
this buildpack.
It is currently used as an opt-in to allow Paketo users to do tests before the old buildpacks get retired.
BP_ENABLE_PACKAGE_MANAGERS=trueTo package this buildpack for consumption:
./scripts/package.sh --version x.x.xThis will create a buildpackage.cnb file under the build directory which you
can use to build your app as follows: pack build <app-name> -p <path-to-app> -b <cpython buildpack> -b <pip buildpack> -b build/buildpackage.cnb -b <other-buildpacks..>.
To run the unit and integration tests for this buildpack:
./scripts/unit.sh && ./scripts/integration.shTo speed up local integration tests run you could clone cpython,
remove python versions you don't need in buildpack.toml and use the local path to the cpython folder in integration.json. Same thing applies to python-package-managers-install.