Description
sdk-python declares tasks: ["lint", "test", "build"], and each task becomes its own job on its own runner. The build task compiles the wheel and throws it away: its dist/ never reaches Upload test artifacts, which only runs under test. So the crate is compiled twice per push and nothing is shared between the jobs.
At the same time apache_iggy.pyi has no freshness gate. The file header says it is generated by pyo3_stub_gen, the README says "nothing in CI checks stub freshness", and the stub has already drifted from the source: describe_options sits in a different position with its return type written as builtins.list[OptionSpec], and two docstrings were edited by hand. Checking this needs a built crate, so today there is nowhere cheap to put the check.
Affected area / component
CI / build / tooling
Proposed solution
Drop the build task and move maturin build -o dist into test:
lint = ruff + cargo fmt + clippy + pyrefly, unchanged
test = wheel + stub check + pytest
Keeping lint separate preserves the per-task status in the checks list, and fail-fast: true on the SDK matrices already cancels test when lint fails, so nothing needs coordinating.
Then add the stub gate to test, right after the wheel is built:
cargo run --bin stub_gen
uv run --no-sync ruff format apache_iggy.pyi
uv run --no-sync ruff check --fix apache_iggy.pyi
git diff --exit-code -- apache_iggy.pyi
The ruff steps are required, not cosmetic: the tracked stub is stub_gen output after ruff, since .pre-commit-config.yaml runs ruff-check --fix and ruff-format over foreign/python/**/*.pyi. Format has to run before check, because the raw output leaves whitespace on blank lines, which check reports but only format fixes.
stub_gen costs a full rebuild in a lint-only job, because clippy leaves nothing behind, but about 10s after maturin build since only pyo3 and above rebuild when the extension-module feature drops out.
Alternatives considered
No response
Contribution
Good first issue
Description
sdk-pythondeclarestasks: ["lint", "test", "build"], and each task becomes its own job on its own runner. Thebuildtask compiles the wheel and throws it away: itsdist/never reachesUpload test artifacts, which only runs undertest. So the crate is compiled twice per push and nothing is shared between the jobs.At the same time
apache_iggy.pyihas no freshness gate. The file header says it is generated by pyo3_stub_gen, the README says "nothing in CI checks stub freshness", and the stub has already drifted from the source:describe_optionssits in a different position with its return type written asbuiltins.list[OptionSpec], and two docstrings were edited by hand. Checking this needs a built crate, so today there is nowhere cheap to put the check.Affected area / component
CI / build / tooling
Proposed solution
Drop the
buildtask and movematurin build -o distintotest:lint= ruff + cargo fmt + clippy + pyrefly, unchangedtest= wheel + stub check + pytestKeeping
lintseparate preserves the per-task status in the checks list, andfail-fast: trueon the SDK matrices already cancelstestwhenlintfails, so nothing needs coordinating.Then add the stub gate to
test, right after the wheel is built:The ruff steps are required, not cosmetic: the tracked stub is stub_gen output after ruff, since
.pre-commit-config.yamlrunsruff-check --fixandruff-formatoverforeign/python/**/*.pyi. Format has to run before check, because the raw output leaves whitespace on blank lines, whichcheckreports but onlyformatfixes.stub_gencosts a full rebuild in a lint-only job, because clippy leaves nothing behind, but about 10s aftermaturin buildsince only pyo3 and above rebuild when the extension-module feature drops out.Alternatives considered
No response
Contribution
Good first issue