The standard Cloud Foundry python-buildpack does not focus on modern Python workflows built around uv. This custom buildpack fills that gap by detecting uv-managed applications, installing a managed Python runtime, and staging locked dependencies for Cloud Foundry.
For an app to be detected by this buildpack, it must include:
pyproject.tomluv.lock
If the app includes a .python-version file, the buildpack uses that version when installing Python.
At release time, the buildpack chooses the web command in this order:
- If the app has a
Procfile, Cloud Foundry uses it directly. - Otherwise, if
pyproject.tomldefines a console script whose name matches[project].name, that script is used. - Otherwise, if
[project.scripts]definesstart, that script is used. - Otherwise, if
main.pyexists, the buildpack usespython3 main.py. - Otherwise, if
app.pyexists, the buildpack usespython3 app.py.
For example, this pyproject.toml:
[project]
name = "my-app"
[project.scripts]
my-app = "server.main:run"
start = "server.main:start"becomes:
python3 -c "from server.main import run; run()"Note:
uvis only available during staging, not at runtime. All dependencies are already baked into the droplet bybin/compile, souv runis unnecessary and would repeat that work on every start. When specifying commands through themanifestor theProcfile, use a direct Python invocation instead.
You can reference the github repository URI or a specific GitHub release.
| Project Example | Description | Deployment Script | Buildpack Reference |
|---|---|---|---|
| my-app-script | src/ layout app with a console script entry point defined in [project.scripts] |
pyproject.toml |
manifest.yml |
| my-app-manifest | App with a custom start command specified directly in the CF manifest | manifest.yml |
manifest.yml |
| my-app-procfile | App using a Procfile to define the web process |
Procfile |
manifest.yml |
| my-app-mta | MTA deployment for SAP BTP Cloud Foundry | pyproject.toml |
mta.yaml |
Check the entire projects inside the examples directory for more details on how to make use of this buildpack.
Download the latest packaged zip from the GitHub Releases page, then upload it to your CF environment.
To upload the buildpack:
cf create-buildpack python-uv-buildpack python-uv_buildpack-cached-vX.Y.Z.zip 1 --enableThe position (1) controls priority when CF auto-detects buildpacks. Adjust as needed relative to your other buildpacks.
... then reference it in your app's manifest.yaml or mta.yaml:**
buildpacks:
- python-uv-buildpackTo update an existing buildpack after a new release:
cf update-buildpack python-uv-buildpack -p python-uv_buildpack-cached-vX.Y.Z.zip --enableRun the buildpack test flow from the repository root:
make test-buildpackThis command:
- stages the sample app into a temporary build directory
- runs
bin/detect - runs
bin/compile - verifies the staged dependencies are importable
- prints the
bin/releaseoutput
You can run a different smoke fixture by passing its directory:
make test-buildpack APP_DIR=test/smoke/my-app-2To clean the temporary staging directories:
make clean-test-buildpackTo start the staged sample app locally after a successful test build:
make start-localThen open http://127.0.0.1:8000/.
To run the full unit test suite:
make unit-testTo run all smoke fixtures:
make smoke-testSee the project Makefile for the supported local commands.
Contributions are welcome.
- Report bugs or request features by opening an issue.
- Fork the repository, create a branch, make your changes, and open a pull request.
- Improve the documentation or examples to make the buildpack easier to adopt.
- Run the local tests before submitting changes when possible.
Copyright (c) 2026 Nicholas Coutinho Checan. Licensed under the MIT License. See LICENSE.