Migrate package metadata from setup.py to pyproject.toml (PEP 621)
@sl0thentr0py 已经在做这个了。
开始于 2026年5月29日。
评估
这个 Issue 还没有评估数据。
描述
Background
The package metadata still lives in setup.py (name, version, dependencies, extras, entry points, classifiers, etc.). pyproject.toml currently only carries tool configuration (coverage, pytest, mypy, ruff).
With the tox/uv migration landing (see #6325, #6327, #6367, and the rest of the chore/migrate-to-tox-uv work), the distribution itself is the last piece still using legacy setuptools configuration. Moving to PEP 621 [project] metadata would:
- Make the project introspectable by modern tooling (
uv sync,uv add,pip install .without executing arbitrary Python, build frontends, dependency scanners, SBOM tools). - Eliminate the
setup.pyexecution step during builds. - Align with the direction setuptools itself recommends.
Scope
Port everything currently in setup.py into pyproject.toml:
-
[build-system]table (setuptools backend) -
[project]table:name,version,description,readme,requires-python,license,authors,urls,classifiers -
[project] dependencies←install_requires -
[project.optional-dependencies]←extras_require(all ~40 extras — names must match exactly; they're public API) -
[project.entry-points.\"opentelemetry_propagator\"]←entry_points -
[tool.setuptools] zip-safe = false -
[tool.setuptools.package-data]forpy.typed(PEP 561) -
[tool.setuptools.packages.find]withtests*excluded - Verify
MANIFEST.instill behaves correctly (or fold intoinclude-package-data) - Update release tooling (
.craft.yml, version-bump scripts) to read/write the version inpyproject.tomlinstead ofsetup.py - Remove
setup.pyonce the above is verified
Verification
-
python -m buildproduces an sdist + wheel byte-identical in contents (modulo metadata format) to the current release -
pip install sentry-sdk[flask],[django],[opentelemetry], etc. resolve identically -
py.typedis shipped in the wheel -
tests/is not shipped in the wheel - OTel propagator entry point is discoverable post-install
- Release pipeline dry-run succeeds
Risks
- Public-facing extras names — a typo silently breaks
pip install sentry-sdk[name]. - Version bump automation — release tooling likely greps
setup.py. python_requires=\">=3.6\"in currentsetup.pylooks stale vs. the rest of the repo; worth confirming the intended floor before carrying it forward.
Related
- Tox/uv migration: #6325, #6327, #6367, et al.
- #6121 (removed
bdist_wheeluniversal option) - #5932 (license classifier inconsistency — pyproject migration is a chance to fix cleanly via
licensefield)
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 672
- 平均合并
- 22 小时 47 分钟
- 30 天内合并 PR
- 224
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-python 的其他 Issue
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7569 · 1 条评论 ·
-
Python
难度 1/5 1 小时以内 新手友好度 85/100
getsentry/sentry-python#7568 · 2 条评论 ·
-
Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#7567 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-python#7543 · 2 条评论 · 已指派 1 人 ·
-
Python
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-python#6992 · 1 条评论 ·
查看 getsentry/sentry-python 的全部 Issue
相似的 Issue
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 75/100
open-webui/open-webui#30750 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
good first issue
难度 1/5 1 小时以内 新手友好度 90/100