Modernize packaging + CI: setup.cfg -> pyproject.toml, legacy workflow -> wads uv stub - #2
Merged
Merged
Conversation
Converts the legacy setuptools packaging to the modern wads layout. Carried across from setup.cfg verbatim: name=videostream2py, version=0.0.2 (matches the released PyPI version, so CI's automatic bump on merge produces the next patch), description, long_description (README.md, text/markdown -> readme), url -> project.urls Homepage, license apache-2.0 -> SPDX "Apache-2.0" string form, install_requires (stream2py), packages=find: -> hatchling auto-discovery. There were no entry_points/console_scripts, no package_data, no extras and no MANIFEST.in/requirements.txt, so nothing else to carry. include_package_data/zip_safe/platforms are setuptools-only and drop out; "any" platform is now expressed as an OS Independent classifier. Filled in what setup.cfg left empty: authors, keywords, classifiers, requires-python (>=3.10). Also adds the standard [tool.ruff] block (without it the repo falls through to ruff's moving default and goes red on unrelated style drift) and the missing .editorconfig. testpaths is set to the package dir rather than the generated ["tests"]: wads CI runs pytest --doctest-modules with no path argument, so collection is driven entirely by testpaths, and ["tests"] (a dir this repo does not have) would silently collect nothing while still reporting green. docsrc/conf.py keeps working unchanged: epythet's parse_config falls back to pyproject.toml when setup.cfg is absent. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
videostream2py/video.py has a module-level `import cv2`, but setup.cfg only
ever declared `stream2py` (which itself declares no dependencies). So a clean
`pip install videostream2py` produced a package whose only module could not be
imported:
>>> import videostream2py.video
ModuleNotFoundError: No module named 'cv2'
This has been latent since 0.0.2 and went unnoticed because the legacy CI ran
pytest in an environment where `isee install-requires` plus the runner image
happened to satisfy it, and because nothing imported the module in a clean env.
Adds `opencv-python` to [project].dependencies, and a [tool.wads.ops.libgl]
entry so CI installs libGL on Linux when the runner image lacks it (the
opencv-python wheels link against it; the check is a no-op when it is already
present).
Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
Replaces the ~90-line legacy workflow (setup-python@v2, checkout@v2, axblack, pylint, twine, isee) with the 5-line stub that calls i2mint/wads/.github/workflows/uv-ci.yml@master. All configuration now lives in pyproject.toml under [tool.wads.ci.*], so this repo picks up wads CI fixes without an edit here. Secret transport: the old workflow referenced PYPI_USERNAME and PYPI_PASSWORD. The uv CI uses token-only PyPI auth, so only PYPI_PASSWORD is passed through; PYPI_USERNAME is no longer needed. No other secrets were referenced, so nothing else had to be carried into [tool.wads.ci.env]. Behavioural deltas worth knowing: - tests now run on the 3.10 + 3.12 matrix (was 3.10 only) plus Windows - docstring validation moves from pylint C0114 to ruff D100 - publishing stays gated on the default branch and on validation passing Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
Both modules lacked one. The legacy CI enforced this via pylint C0114 (and was failing on it); the new CI enforces the same thing via ruff D100, which is selected in [tool.ruff.lint]. Docstrings are also what epythet extracts to build the published API docs, so the package page was empty. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
Pure formatting, no behaviour change. The old CI formatted with axblack (single quotes); the new CI runs `ruff format`, which normalizes to double quotes. Doing it here keeps the first post-merge CI push-back commit empty of unrelated churn. Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
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.
Summary
Brings
videostream2pyfrom the legacy generation (setup.cfg+setup.py+a hand-rolled ~90-line workflow) onto the current wads standard: a
pyproject.tomlsingle source of truth with a hatchling backend, and a 5-lineci.ymlstub that calls the reusable workflowi2mint/wads/.github/workflows/uv-ci.yml@master.What changed
Five commits, one concern each:
setup.cfg/setup.py->pyproject.toml(hatchling) +.editorconfigopencv-pythonruntime dependency (see below)ruff format(quote normalization; axblack -> ruff)Inventory carried across from setup.cfg
name = videostream2py[project].nameversion = 0.0.2[project].version— deliberately kept at the released PyPI version so CI's auto-bump on merge yields the next patchdescription[project].descriptionlong_description = file:README.md+text/markdown[project].readme = "README.md"url[project.urls].Homepagelicense = apache-2.0license = "Apache-2.0"(SPDX string form;LICENSEkept and now shipped in the wheel'sdist-info/licenses/)install_requires = stream2py[project].dependenciespackages = find:platforms = anyOperating System :: OS IndependentclassifierNothing was dropped: there were no
entry_points/console_scripts, nopackage_data, no extras, and noMANIFEST.in/requirements.txt.include_package_data,zip_safe,description_file,root_urlanddisplay_nameare setuptools-/wads-legacy-only keys with no pyproject equivalent.Filled in what setup.cfg left empty:
authors,keywords,classifiers,requires-python = ">=3.10".docsrc/conf.pyis untouched and still works — epythet'sparse_configfalls backto
pyproject.tomlwhensetup.cfgis absent.Latent bug found and fixed
videostream2py/video.pyhas a module-levelimport cv2, butopencv-pythonwasnever declared (and
stream2pydeclares no dependencies of its own). A cleanpip install videostream2pytherefore produced a package whose only module couldnot be imported:
Latent since 0.0.2. Fixed by declaring
opencv-python, plus a[tool.wads.ops.libgl]entry so CI installs
libGLon Linux if the runner image ever lacks it (theopencv-python wheels link against it). On today's runner the check reports
libgl is already installed, so it is a no-op safety net.testpathswads-migrateemitstestpaths = ["tests"]unconditionally, and wads CI runspytest --doctest-moduleswith no path argument — so on a repo with notop-level
tests/dir that setting collects nothing while still reporting green.Pointed it at the package dir instead. Verified in the branch CI log: the package
is now collected and
videostream2py/video.pyshows up in the coverage report(i.e. it is really imported), which is what makes the
cv2gap detectable at all.Gate results
priv test-dependents videostream2pyno-tests— 0 pass, 0 fail, 1 no-testspass— 1 pass, 0 fail, 0 no-testsAlso verified locally:
ruff checkclean,ruff format --checkclean,uv buildproduces a correct sdist + wheel.Branch CI
https://github.com/i2mint/videostream2py/actions/runs/30859318643 — success
Previous
masterrun was red, so this also clears the repo's red-CI finding.Note: the test matrix widens from 3.10-only to 3.10 + 3.12 + Windows, and
docstring validation moves from
pylint C0114toruff D100.Secrets
The old workflow referenced
PYPI_USERNAMEandPYPI_PASSWORD. The uv CI usestoken-only PyPI auth, so the stub passes only
PYPI_PASSWORD;PYPI_USERNAMEisobsolete. No other secrets were referenced, so
[tool.wads.ci.env]stays empty.Deliberately left undone
(the one docstring example needs a camera and is
+SKIPed). Out of scope for apackaging pass; belongs to a test-coverage pass.
from videostream2py import VideoCapturestillfails. That is an API change, not a packaging change, so it is filed separately
as Package exports nothing:
from videostream2py import VideoCapturefails #1.Also done (repo settings, not in this diff)
Homepage set to the docs URL, topics synced from the new
keywords, Discussionsenabled — the ecosystem defaults.