Migrate developer automation from make to tox#242
Conversation
webknjaz
left a comment
There was a problem hiding this comment.
make cythonize is not used anywhere. No need to wrap it or keep it in any way.
Also, don't make changes in the packaging/ folder.
Borrow the envs from https://github.com/aio-libs/aiosignal/blob/master/tox.ini
@aiolibsbot rr
|
@aiolibsbot rr |
PR Review — Migrate developer automation from make to toxThe mechanical migration looks clean — Makefile is a sensible thin wrapper, tox.ini matches the aio-libs naming convention, and the linter workflow swap is correct. Two structural concerns remain before merge: (1) 🟡 Important1. Single .pkg-compiled env may produce ABI-mismatched wheels across the Python matrix (`tox.ini`, L156-162)
The test plan only validates The aiosignal layout the maintainer pointed at is pure-Python, so it doesn't model this case. Look at a compiled aio-libs/ansible project (e.g. ansible/pylibssh, which webknjaz also referenced) for the pattern — usually a factor-parameterised 2. PR description references a `cython` env that does not exist in tox.ini (`tox.ini`, L1-15)The PR body and This is consistent with the maintainer's review (" Also double-check the 🟢 Suggestions1. `make doc` no longer runs doctest + spelling (`Makefile`, L42-47)The previous Makefile chained For habitual contributors this is a silent behaviour change — they will run Either restore the dependency ( 2. `HOME` isolation may break tools that look for user config (gh, git, ssh) (`tox.ini`, L63-68)
If no test currently reads from 3. Consider `tox-uv` per maintainer's follow-up review comment (`tox.ini`, L109-115)Maintainer suggested If you want to keep classic venv as a fallback, leave the 4. `commands_pre` cleans `build/*` but not the in-tree `*.c` / `*.so` from previous builds (`tox.ini`, L86-92)The pre-command nukes But the in-tree PEP 517 backend writes If this isn't an issue today (because the backend writes only into Checklist
SummaryThe mechanical migration looks clean — Makefile is a sensible thin wrapper, tox.ini matches the aio-libs naming convention, and the linter workflow swap is correct. Two structural concerns remain before merge: (1) To rebase addressing only specific severity levels, use: |
Migrates the developer automation from ``make`` to ``tox`` per aio-libs#51. A new top-level ``tox.ini`` declares the test matrix (``pyXY-pure`` / ``pyXY-compiled`` variants driven by the PEP 517 ``pure-python`` config setting), plus dedicated envs for ``lint`` (pre-commit), ``cython`` (regenerate ``*.c`` from ``*.pyx``), ``build-dists``, ``docs``, ``doctest``, ``spelling``, and ``benchmark``. The existing ``Makefile`` becomes a thin wrapper around ``tox -e <env>`` so the familiar ``make test`` / ``make doc`` invocations keep working. The in-tree PEP 517 backend's Cython import is moved inside ``maybe_prebuild_c_extensions`` so the module loads cleanly under frontends that keep the backend subprocess alive across PEP 517 hook calls (tox's ``pyproject_api``), in addition to the existing fresh-subprocess frontends (pip, ``python -m build``). The reusable linter workflow is rewired to call ``tox -e lint`` and ``tox -e spelling`` directly so CI mirrors the local developer entrypoints.
Rebase with requested adjustmentsBranch Changes applied
StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
253d215 to
140c815
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #242 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 10 10
Lines 439 439
Branches 17 17
=======================================
Hits 437 437
Misses 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Rebase with requested adjustmentsBranch StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
There was a problem hiding this comment.
Use two-space indents in ini files.
|
done in #243 |
Summary
Implements the migration to
toxoutlined in #51. A top-leveltox.inibecomes the canonical entrypoint for the project'sdeveloper-facing automation; the existing
Makefileis reducedto a thin wrapper around
tox -e <env>so familiarmakeinvocations keep working.
Closes #51
Changes
tox.iniwith the matrix and supporting envs:pyXY-pure/pyXY-compiledfor the test suite (thefactor toggles the PEP 517
pure-pythonsetting, whichselects whether Cython is compiled).
lint— pre-commit across the tree.cython— regenerate the*.csiblings of*.pyx.build-dists— produce an sdist + pure-Python wheel.docs/doctest/spelling— Sphinx builders.benchmark— CodSpeed-instrumented benchmarks.Makefileas thin wrappers around the new envs(
make test→tox -e py312-compiledby default; overridewith
PY=/VARIANT=).packaging/pep517_backend/_backend.pyinsidemaybe_prebuild_c_extensionsso the backend works underfrontends that keep the PEP 517 subprocess alive across hook
calls (tox's
pyproject_api), as well as the existingfresh-subprocess frontends (pip,
python -m build).tox -e lintandtox -e spellinginto the reusablelinter workflow so CI mirrors the local developer entrypoints.
tox >= 4.4torequirements/dev.txt.AGENTS.mdanddocs/contributing/guidelines.rstto document the
toxentrypoints alongside the legacymakewrappers, and add aCHANGES/51.contrib.rstnewsfragment.
Test plan
tox listenumerates all envs.tox -e py312-pure— 23 passed, 4 skipped.tox -e py312-compiled— 43 passed, 4 skipped.tox -e cython— regenerates_helpers_c.ccleanly.tox -e build-dists— produces sdist + pure wheel.tox -e lint— every hook (other than thedocker-bound
actionlint-docker, which the projectalready skips on pre-commit.ci) passes.
config; CI will exercise the remaining cells.
Generated by Kōan /implement
Quality Report
Changes: 8 files changed, 382 insertions(+), 64 deletions(-)
Code scan: clean
Tests: passed (16
tests)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline