Consider replacing Hatch with uv for project and dependency management
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- build-system, tooling
调研方向
从项目的 pyproject.toml 以及列出的、用于构建、环境、脚本、版本管理、linting 和测试的 Hatch 命令开始。将这些职责与 uv 进行比较,包括提议的 uv.lock,并检查 function-template-python 的继承设置。完成的标准是记录将获得和失去的内容,并决定是否在两个项目中替换 Hatch。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 12
- 派生
- 15
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 7
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
crossplane/function-sdk-python 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement
难度 5/5 一周以上 新手友好度 42/100
-
bug
难度 4/5 3-5 天 新手友好度 35/100
crossplane/function-sdk-python#129 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 10/100
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
crossplane/function-sdk-python#5 · 1 条评论 ·
查看 crossplane/function-sdk-python 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
canonical/paas-charm#368 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
tech debt
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
qualcomm/qai-appbuilder#275 ·