build: move static metadata to pyproject.toml [project] table#30
Draft
hozblok wants to merge 1 commit into
Draft
build: move static metadata to pyproject.toml [project] table#30hozblok wants to merge 1 commit into
hozblok wants to merge 1 commit into
Conversation
Static metadata (name, description, classifiers, license, authors, urls,
requires-python, optional-dependencies, package layout) now lives in
pyproject.toml's [project] table per PEP 621. setup.py is now a thin
imperative shim: it still owns the version-string read (kept as a single
source of truth, also feeding the VERSION_INFO macro on the C++ side)
and the Pybind11Extension wiring.
This change makes the package legible to modern tooling — uv, pip,
hatch's project introspection, dependency scanners, IDE indexers — that
parse pyproject.toml without invoking setup.py.
Verified by rebuilding the extension, running the full pytest suite
(316/316), and inspecting `importlib.metadata.metadata('formula')` on
the installed package — name, version, summary, license, author email,
classifiers all carry through correctly.
See ai/improvements_2026-05-09.md item #17.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
db81245 to
b2c9481
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes item #17 from
ai/improvements_2026-05-09.md.Problem. All package metadata lived in
setup.py. Modern tooling (uv, hatch, pip-tools, dependency scanners, IDE indexers) readspyproject.tomldirectly and shouldn't need to invokesetup.pyto learn the name, version, classifiers, or dependencies. Setuptools >= 61 has supported declarative[project]for years; the project's build system already requiressetuptools>=61in[build-system].Fix.
pyproject.toml— add a complete[project]table:name,description,readme,license+license-files,authors,requires-python,classifiers,[project.urls],[project.optional-dependencies]. Version stays dynamic (dynamic = ["version"]) so__version__insrc/formula/__init__.pyremains the single source of truth. Package discovery moves to[tool.setuptools.package-dir]and[tool.setuptools.packages.find].setup.py— trim to the imperative bits: read__version__, computeBOOST_HEADERSandEXTRA_COMPILE_ARGS, declare thePybind11Extension, and callsetup(version=..., ext_modules=..., cmdclass=...). The version pass-through keeps theVERSION_INFOmacro on the C++ side fed from the same string.Verification. Rebuilt the extension and ran the full pytest suite (316/316).
importlib.metadata.metadata('formula')on the installed package reports name, version, summary, license, author email, and all 11 classifiers correctly.