Modernize: ruff, hatch-vcs, Trusted Publishing, Markdown docs - #153
Merged
Merged
Conversation
Aligns the project's CI/release setup with the reference layout used by other BlueDynamics packages. Tooling - Derive the version from git tags via hatch-vcs; drop the static `version` from pyproject.toml. Releases are made by tagging. - Switch Python lint/format from black + isort to ruff (config mirrors the reference, with Zope/Plone-idiomatic ignores: A001/A002/A003, RUF012). Reformat the codebase accordingly. Two real fixes fell out: `raise ... from err` in the control panel (B904) and `contextlib.suppress` in the uninstall handler (SIM105). CI / release - Restructure GitHub Actions into a `CI` umbrella workflow (ci.yaml) that calls reusable `qa.yaml` (ruff) and `tests.yaml` (the existing Plone 6.0-6.2 / Python 3.10-3.14 matrix, now `workflow_call`). - Add `release.yaml`: build & inspect the package, publish in-dev builds to Test PyPI after CI passes on main, and publish tagged releases to PyPI -- both via OIDC Trusted Publishing (no API tokens). Docs - Update the README development workflow (ruff instead of black/isort) and the CI badge; note that .mo catalogs are compiled at build time. Full test suite green (240 passed); `ruff check .` and `ruff format --check .` clean; the build (hatch-vcs + babel hook) produces sdist + wheel containing the compiled en/es .mo catalogs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…process Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…epo) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ranch Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Convert README, CHANGES, CONTRIBUTORS, LICENSE and TODO from .rst to .md (GitHub-Flavored Markdown), and update all references: - pyproject.toml: `readme = "README.md"` (now `text/markdown`), and the ChangeLog URL points to CHANGES.md on `main`. - RELEASE.md: refer to CHANGES.md. - Remove MANIFEST.in, which is unused under the hatchling build backend. The `tests/*.rst` doctest files are intentionally left as reStructuredText (they are executed by the doctest runner, not documentation). Verified: `python -m build` yields `Description-Content-Type: text/markdown`, .mo catalogs still ship, and the full suite (incl. doctests) passes (240). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No pkg_resources / setuptools usage anywhere in the code (implicit namespace packages); it was a leftover from the setup.py era. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Coveralls has not been fed since 2021 (no coverage upload step in CI) and the badge pointed at the old 'master' branch. Local coverage via 'make coverage' is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Pre-2.0.0 modernization. Aligns the CI/release setup with the reference layout (à la the BlueDynamics packages): ruff, tag-driven versioning, OIDC Trusted Publishing, plus a
RELEASE.mdand a docs-to-Markdown conversion.What changed
Versioning (hatch-vcs)
versionis removed frompyproject.toml. Releases are made by tagging.Linting (ruff)
A001/A002/A003,RUF012;SIM117/T20ignored in tests). Whole-tree reformat. Two real fixes fell out:raise … from err(B904) andcontextlib.suppress(SIM105).CI / release workflows
ci.yaml—CIumbrella (push-to-main + PRs) calling reusableqa.yaml(ruff) andtests.yaml(Plone 6.0–6.2 / Python 3.10–3.14 matrix, nowworkflow_call,fetch-depth: 0for hatch-vcs).release.yaml— build & inspect, publish in-dev builds to Test PyPI after CI onmain, publish tagged Releases to PyPI, both via Trusted Publishing.Docs
RELEASE.mddocuments the whole release process (tagging, Trusted Publishing, requiredrelease-pypienvironment protection with reviewers + a tag deployment rule, and the exact PyPI/Test-PyPI publisher field tables).README,CHANGES,CONTRIBUTORS,LICENSE,TODOfrom reStructuredText to Markdown;pyprojectreadmeis nowtext/markdown; removed the unusedMANIFEST.in. Thetests/*.rstdoctest files stay as RST (they are executed, not docs).ci.yaml.Verification
ruff check .+ruff format --check .clean.python -m build→ sdist + wheel withDescription-Content-Type: text/markdown, compiled en/es.mocatalogs, and the hatch-vcs version.See
RELEASE.md. In short: create GitHub environmentsrelease-pypi(protect with required reviewers + a tag deployment rule — mandatory for thiscollectiverepo) andrelease-test-pypi; add Trusted Publishers on PyPI and Test PyPI (ownercollective, repopas.plugins.ldap, workflowrelease.yaml, envrelease-pypi/release-test-pypi).Note on version series
Last tag is
1.8.4, so untagged builds are1.8.4.devN. For 2.0.0-series dev builds tag2.0.0a1; for the final release tag2.0.0.Follow-up (not in this PR)
mxmake/Makefilestill carries the old black/isort/zpretty topics; regenerating it from an updatedmx.ini(ruff topic) is a separate, tooling-dependent change. CI no longer relies on the Makefile for linting.🤖 Generated with Claude Code