Motivation
This follows from the research and proposal in clamsproject/mmif-python#327 (comment), which assessed the current Python packaging landscape and concluded that setup.py is no longer necessary for projects targeting Python 3.10+.
clams-vocabulary is a recent addition to our SDK fleet, and it started with pyproject.toml from the beginning. The experience from setting up its build process and CI automation is now pushed to our shared reusable GHA repo as sdk-publish-pyproj.yml. This issue tracks migrating clams-python to the same pattern.
Compared to mmif-python, clams-python is simpler -- it has no build-time code generation or remote resource fetching. The only dynamic part is clams/ver/__init__.py, which setup.py generates from a VERSION file. This goes away with setuptools-scm.
Planned changes
- Add
pyproject.toml with setuptools-scm for git-tag-based versioning (no VERSION file). All dependencies, optional dependency groups (dev, docs, test), entry points, package data, and pytest config move here.
- Add
build-tools/ scripts (build.py, test.py, publish.py) -- thin wrappers matching the pattern established in clams-vocabulary. These are called by sdk-publish-pyproj.yml in CI and can also be run locally.
- Convert
clams/ver/__init__.py from a generated file to a committed source file using importlib.metadata.version("clams-python"). Preserves backward compatibility for from clams.ver import __version__.
- Update
documentation/conf.py -- update_target_spec() currently reads the VERSION file directly; replace with importlib.metadata.version('clams-python').
- Update
build-tools/docs.py -- install docs dependencies from .[docs] optional group instead of requirements.docs.txt.
- Switch CI --
publish.yml changes publish-pypi job from sdk-publish.yml (Makefile-based) to sdk-publish-pyproj.yml.
- Delete
setup.py, Makefile, MANIFEST.in, VERSION, requirements.txt, requirements.dev, build-tools/requirements.docs.txt.
Motivation
This follows from the research and proposal in clamsproject/mmif-python#327 (comment), which assessed the current Python packaging landscape and concluded that
setup.pyis no longer necessary for projects targeting Python 3.10+.clams-vocabularyis a recent addition to our SDK fleet, and it started withpyproject.tomlfrom the beginning. The experience from setting up its build process and CI automation is now pushed to our shared reusable GHA repo assdk-publish-pyproj.yml. This issue tracks migratingclams-pythonto the same pattern.Compared to
mmif-python,clams-pythonis simpler -- it has no build-time code generation or remote resource fetching. The only dynamic part isclams/ver/__init__.py, whichsetup.pygenerates from aVERSIONfile. This goes away withsetuptools-scm.Planned changes
pyproject.tomlwithsetuptools-scmfor git-tag-based versioning (noVERSIONfile). All dependencies, optional dependency groups (dev,docs,test), entry points, package data, and pytest config move here.build-tools/scripts (build.py,test.py,publish.py) -- thin wrappers matching the pattern established inclams-vocabulary. These are called bysdk-publish-pyproj.ymlin CI and can also be run locally.clams/ver/__init__.pyfrom a generated file to a committed source file usingimportlib.metadata.version("clams-python"). Preserves backward compatibility forfrom clams.ver import __version__.documentation/conf.py--update_target_spec()currently reads theVERSIONfile directly; replace withimportlib.metadata.version('clams-python').build-tools/docs.py-- install docs dependencies from.[docs]optional group instead ofrequirements.docs.txt.publish.ymlchangespublish-pypijob fromsdk-publish.yml(Makefile-based) tosdk-publish-pyproj.yml.setup.py,Makefile,MANIFEST.in,VERSION,requirements.txt,requirements.dev,build-tools/requirements.docs.txt.