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.py execution step during builds.
- Align with the direction setuptools itself recommends.
Scope
Port everything currently in setup.py into pyproject.toml:
Verification
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 current setup.py looks stale vs. the rest of the repo; worth confirming the intended floor before carrying it forward.
Related
Background
The package metadata still lives in
setup.py(name, version, dependencies, extras, entry points, classifiers, etc.).pyproject.tomlcurrently 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-uvwork), the distribution itself is the last piece still using legacy setuptools configuration. Moving to PEP 621[project]metadata would:uv sync,uv add,pip install .without executing arbitrary Python, build frontends, dependency scanners, SBOM tools).setup.pyexecution step during builds.Scope
Port everything currently in
setup.pyintopyproject.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*excludedMANIFEST.instill behaves correctly (or fold intoinclude-package-data).craft.yml, version-bump scripts) to read/write the version inpyproject.tomlinstead ofsetup.pysetup.pyonce the above is verifiedVerification
python -m buildproduces an sdist + wheel byte-identical in contents (modulo metadata format) to the current releasepip install sentry-sdk[flask],[django],[opentelemetry], etc. resolve identicallypy.typedis shipped in the wheeltests/is not shipped in the wheelRisks
pip install sentry-sdk[name].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
bdist_wheeluniversal option)licensefield)