cloudfoundry / cloudfoundry/python-buildpack

Support for the uv package manager (uv.lock)

Open
#1,202 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
122
Forks
281
PR merge metrics
No merged PRs in 30d

Description

Hi,

I couldn't find any existing or past issues mentioning this.

It'd be great to support uv for dependency management. It's one of the most widely used Python package managers, and a lot of projects now standardise on uv.lock the way they used to on Pipfile.lock. A good number of our projects at SAP have moved over to uv + uv.lock entirely, and today those apps can't be pushed as-is -- you end up keeping a separate requirements.txt in the repo by hand, purely for compatibility with the CF Python buildpack, which rather defeats the point of having a lockfile.

The nice part is the buildpack already has the right shape for this. pipenv support works by generating a requirements.txt (from Pipfile.lock) and then handing off to the normal pip install path -- uv fits that exact pattern, and uv export exists for precisely this purpose.

Rough idea I'm thinking of would be:

  • Detect uv.lock (+ pyproject.toml), much like Pipfile is detected today
  • Run uv export --format requirements-txt to turn the lock into a requirements.txt
  • Install it with uv pip install (uv's installer is dramatically faster than pip), falling back to pip
  • Read the Python version from .python-version / requires-python in pyproject.toml

Routing through a generated requirements.txt keeps all the existing machinery working unchanged, so it should be a reasonably contained change. plus uv ships as a PyPI wheel, so it can be added as a manifest dependency the same way pipenv is.

I'd be happy to put together a PR if this seems worth including.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing Pipfile/Pipfile.lock support and its generated requirements.txt flow, then compare that path with uv export and the normal pip install path. Done means projects containing uv.lock and pyproject.toml can be pushed without a hand-maintained requirements.txt, with the stated Python-version and installer fallbacks covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.