cloudfoundry / cloudfoundry/python-buildpack

Support for the uv package manager (uv.lock)

Đang mở
#1,202 2 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Go
Star
122
Fork
281
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách lần theo phần hỗ trợ hiện có cho Pipfile/Pipfile.lock và luồng tạo requirements.txt của nó, sau đó so sánh đường đi này với uv export và đường đi pip install thông thường. Được xem là hoàn tất khi các dự án chứa uv.lock và pyproject.toml có thể được push mà không cần requirements.txt được duy trì thủ công, đồng thời các fallback đã nêu cho phiên bản Python và trình cài đặt được bao phủ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.