Skip to content

Modernize: ruff, hatch-vcs, Trusted Publishing, Markdown docs - #153

Merged
jensens merged 8 commits into
mainfrom
modernize-ci-release
Jun 22, 2026
Merged

jensens merged 8 commits into
mainfrom
modernize-ci-release

Conversation

@jensens

@jensens jensens commented Jun 22, 2026 •

Copy link
Copy Markdown
Member

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.md and a docs-to-Markdown conversion.

What changed

Versioning (hatch-vcs)

  • Version is derived from git tags; the static version is removed from pyproject.toml. Releases are made by tagging.

Linting (ruff)

  • Switched Python lint/format from black + isort to ruff (config mirrors the reference, with Zope/Plone-idiomatic ignores: A001/A002/A003, RUF012; SIM117/T20 ignored in tests). Whole-tree reformat. Two real fixes fell out: raise … from err (B904) and contextlib.suppress (SIM105).

CI / release workflows

  • ci.yaml — CI umbrella (push-to-main + PRs) calling reusable qa.yaml (ruff) and tests.yaml (Plone 6.0–6.2 / Python 3.10–3.14 matrix, now workflow_call, fetch-depth: 0 for hatch-vcs).
  • release.yaml — build & inspect, publish in-dev builds to Test PyPI after CI on main, publish tagged Releases to PyPI, both via Trusted Publishing.

Docs

  • RELEASE.md documents the whole release process (tagging, Trusted Publishing, required release-pypi environment protection with reviewers + a tag deployment rule, and the exact PyPI/Test-PyPI publisher field tables).
  • Converted README, CHANGES, CONTRIBUTORS, LICENSE, TODO from reStructuredText to Markdown; pyproject readme is now text/markdown; removed the unused MANIFEST.in. The tests/*.rst doctest files stay as RST (they are executed, not docs).
  • README dev-workflow updated to ruff; CI badge points to ci.yaml.

Verification

  • ruff check . + ruff format --check . clean.
  • Full suite green: 240 passed (unit + LDAP integration + doctests).
  • python -m build → sdist + wheel with Description-Content-Type: text/markdown, compiled en/es .mo catalogs, and the hatch-vcs version.

⚠️ Required one-time setup before releasing (maintainers)

See RELEASE.md. In short: create GitHub environments release-pypi (protect with required reviewers + a tag deployment rule — mandatory for this collective repo) and release-test-pypi; add Trusted Publishers on PyPI and Test PyPI (owner collective, repo pas.plugins.ldap, workflow release.yaml, env release-pypi / release-test-pypi).

Note on version series

Last tag is 1.8.4, so untagged builds are 1.8.4.devN. For 2.0.0-series dev builds tag 2.0.0a1; for the final release tag 2.0.0.

Follow-up (not in this PR)

mxmake/Makefile still carries the old black/isort/zpretty topics; regenerating it from an updated mx.ini (ruff topic) is a separate, tooling-dependent change. CI no longer relies on the Makefile for linting.

🤖 Generated with Claude Code

jensens and others added 6 commits June 22, 2026 15:39
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>
@jensens jensens changed the title Modernize tooling & CI: ruff, hatch-vcs, Trusted Publishing Modernize: ruff, hatch-vcs, Trusted Publishing, Markdown docs Jun 22, 2026
jensens and others added 2 commits June 22, 2026 18:05
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>
@jensens
jensens merged commit eaebf36 into main Jun 22, 2026
7 checks passed
@jensens
jensens deleted the modernize-ci-release branch June 22, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant