Consider replacing Hatch with uv for project and dependency management
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Bắt đầu với pyproject.toml của dự án và các lệnh Hatch được liệt kê để build, môi trường, script, quản lý phiên bản, linting và kiểm thử. So sánh các trách nhiệm đó với uv, bao gồm uv.lock được đề xuất, và xem xét function-template-python để đánh giá thiết lập được kế thừa. Công việc được xem là hoàn tất khi đã ghi lại những gì sẽ đạt được và mất đi, đồng thời đưa ra quyết định về việc có thay thế Hatch trong cả hai dự án hay không.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What problem are you facing?
When I created this SDK in November 2023, the Python build and project management space was crowded. There was Hatch, Poetry, PDM, Flit, setuptools, and probably others I'm forgetting. There wasn't a clear winner. I picked Hatch because it was a PyPA project, it had a clean pyproject.toml-based configuration, and it covered everything I needed: environments, scripts, building, versioning, and linting (via its Ruff integration).
Today we use Hatch for:
- Building wheels and sdists (
hatch build), usinghatchlingas the PEP 517 build backend. - Environments with isolated dependencies — a
generateenv for protoc, adocsenv for pdoc, and ahatch-static-analysisenv for Ruff. - Scripts like
hatch run generate:protocandhatch run docs:generate. - Version management — reading the version from
__version__.pyat build time. - Linting via
hatch fmt, which wraps Ruff. - Testing via
hatch test, which wraps pytest.
function-template-python uses the same setup, and any new functions built from it will inherit it.
Hatch works. I don't have a concrete problem with it.
What I do have is a growing sense that the ecosystem has converged on uv in the ~18 months since I made this choice. uv didn't exist when I picked Hatch — its first release was February 2024, three months after this SDK. Since then it's grown to 82k GitHub stars (vs Hatch's 7.2k and Poetry's 34.3k) and 14,600 dependent repositories (vs Hatch's 1,800). It has a full-time team at Astral and ships releases at a pace that's hard to ignore.
We already use Astral's Ruff for linting and formatting, and I'm interested in their ty type checker too. Adopting uv would mean our Python build toolchain is entirely Astral: uv for project management, Ruff for linting, and potentially ty for type checking. That's less build plumbing for contributors to learn and install.
uv would also give us a lockfile (uv.lock) for pinning transitive dependencies, which Hatch doesn't support. We pin direct dependencies today but have no control over what versions of their transitive dependencies get installed.
How could this Function help solve your problem?
I think we should evaluate replacing Hatch with uv for project and dependency management in this SDK and in function-template-python. I'll follow up with a comment breaking down what we'd gain and what we'd lose.
- Ngôn ngữ chính
- Python
- Star
- 12
- Fork
- 15
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 7
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của crossplane/function-sdk-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
crossplane/function-sdk-python#129 · 1 bình luận ·
-
Dependency Dashboard Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 10/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
crossplane/function-sdk-python#5 · 1 bình luận ·
Tất cả issue của crossplane/function-sdk-python
Issue tương tự
-
Add: hunch Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DiamondLightSource/dodal#2211 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openml/openml-python#1749 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sipyourdrink-ltd/bernstein#6191 ·