Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Consider replacing Hatch with uv for project and dependency management

未关闭
#199 4 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃
技术栈
python

调研方向

从项目的 pyproject.toml 以及列出的、用于构建、环境、脚本、版本管理、linting 和测试的 Hatch 命令开始。将这些职责与 uv 进行比较,包括提议的 uv.lock,并检查 function-template-python 的继承设置。完成的标准是记录将获得和失去的内容,并决定是否在两个项目中替换 Hatch。

由索引模型根据 Issue 内容生成。

描述

enhancement
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), using hatchling as the PEP 517 build backend.
  • Environments with isolated dependencies — a generate env for protoc, a docs env for pdoc, and a hatch-static-analysis env for Ruff.
  • Scripts like hatch run generate:protoc and hatch run docs:generate.
  • Version management — reading the version from __version__.py at 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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

crossplane/function-sdk-python 的其他 Issue

查看 crossplane/function-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。