cloudfoundry / cloudfoundry/python-buildpack

Support for the uv package manager (uv.lock)

Aperta
#1,202 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Go
Stelle
122
Fork
281
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia tracciando il supporto esistente per Pipfile/Pipfile.lock e il relativo flusso di generazione di requirements.txt, quindi confronta questo percorso con uv export e con il normale flusso di pip install. Il lavoro è completato quando i progetti che contengono uv.lock e pyproject.toml possono essere inviati senza un requirements.txt mantenuto manualmente, con i fallback indicati per la versione di Python e l'installer coperti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.