build: migrate packaging from setup.py to pyproject.toml - #435
Merged
Conversation
Move all project metadata, dependencies, and package-data declarations into a PEP 621 pyproject.toml using the setuptools build backend. - Add pyproject.toml with dynamic version, deps, optional-dependencies - Reduce setup.py to a minimal shim that supplies only the version (preserving the git-describe dev-suffix fallback) - Delete setup.cfg (unused [aliases] test=pytest) and MANIFEST.in (data-file globs now in [tool.setuptools.package-data]) - Switch python-publish workflow to `python -m build` - Inline metadata in conda recipe (drop load_setup_py_data)
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.
This PR modernizes the Python packaging configuration by migrating project metadata and dependencies from the legacy
setup.pyto a declarativepyproject.tomlusing PEP 621. The CI publish workflow and Conda recipe are updated accordingly to use the modernbuildtoolchain instead of the deprecatedpython setup.py sdist bdist_wheelinvocation.Changes
pyproject.toml(new): Declares the build system (setuptools>=64,wheel), all project metadata, classifiers, dependencies, and optional-dependency groups (docs,tests); version is declared as dynamic and supplied bysetup.py. Package data previously enumerated inMANIFEST.inis now declared under[tool.setuptools.package-data], and package discovery is constrained totyphon*via[tool.setuptools.packages.find].setup.py: Reduced to a minimal shim that readstyphon/VERSION(with agit describefallback for dev builds) and passes the version tosetup(). All metadata, classifiers, andinstall_requirespreviously duplicated here have been removed.MANIFEST.in(deleted): No longer required since package data is now declared declaratively inpyproject.toml.setup.cfg(deleted): Removed the obsolete[aliases] test=pytestshim that is no longer used by modern tooling..github/workflows/python-publish.yml: Replacedsetuptools wheelwithbuildand switched the build command frompython setup.py sdist bdist_wheeltopython -m build, aligning the release pipeline with PEP 517.conda/conda.recipe/meta.yaml: Dropped theload_setup_py_dataintrospection ofsetup.pyand the associated Jinja loops overinstall_requires/url/license/description; the runtime dependencies andaboutmetadata are now listed statically, with the homepage pointing at the dev URL and the summary explicitly written out.Breaking Changes
requires-python = ">=3.12"(matching the existing classifiers); the previouspython_requires="~=3.12"was effectively equivalent, so no runtime breakage is expected, but consumers building from source must usesetuptools>=64and a PEP 517-compatible build frontend (e.g.python -m build).