Skip to content

feat(ci): tests-python.yml for the Python SDK workspace - #1406

Draft
yujiyokoo wants to merge 2 commits into
feat/python-sdk-skeletonfrom
feat/python-sdk-ci
Draft

yujiyokoo wants to merge 2 commits into
feat/python-sdk-skeletonfrom
feat/python-sdk-ci

Conversation

@yujiyokoo

Copy link
Copy Markdown
Contributor

Summary

The Python SDK at languages/python had no CI. This adds tests-python.yml. It runs the workspace's Rust checks and pytest on Python 3.9 and 3.14, and builds one wheel for each of the six platforms the FFI ships for. Nothing is published.

Changes

  • .github/workflows/tests-python.yml: two jobs. python runs fmt, clippy, cargo test --locked, and pytest on both interpreters. wheels builds six abi3-py39 release wheels, uploads them as artifacts, and writes the build time per platform to the job summary. No job receives a CS_* credential.
  • scripts/__tests__/python-ci.test.mjs: holds the workflow to the tree. The path filter must cover every path dependency in the workspace's Cargo.lock. The Python matrix must be the requires-python floor and the version in mise.toml. The wheel matrix must match the protect-ffi platform packages.
  • scripts/__tests__/eql-suite-ci.test.mjs: counts a mise run as an EQL task only from a step that runs under packages/eql. Before this, mise run test from languages/python was read as EQL's test task.
  • scripts/__tests__/lib/workflows.mjs: two shared helpers, triggers and runWorkingDirectory. Six existing guards switch to triggers.
  • languages/python/Cargo.lock: re-seeded from the root lock. The old one named crate versions the root no longer uses, so every --locked check failed.
  • tests.yml: excludes languages/python/** from its live gate, as it does for the Go module.
  • AGENTS.md, languages/python/mise.toml: notes on the workflow, the lock re-seeding, and why this workspace uses plain cargo test.

Verification

  • scripts/__tests__ meta-tests: 83 files pass.
  • In languages/python: cargo fmt --all --check, cargo clippy --locked, mise run test:cargo, and mise run test pass locally.
  • shellcheck is clean on every run: block.
  • No CI run has happened yet. The six wheel legs are untested until the first run of this PR.

Related

Closes #1383. Stacked on #1405. The live test job is #1389.

Review notes

No Python lockfile is added. The package has no runtime dependency, so only pytest and maturin could be locked. CI resolves both from PyPI without a lock. Say if you want a uv.lock in this PR.

🤖 Generated with Claude Code

yujiyokoo and others added 2 commits October 27, 2026 19:09
The Python workspace had no CI. The new root workflow runs, on pull
requests touching the workspace or the crates it compiles and on every
push to main:

- `python`, a matrix on Python 3.9 (the requires-python floor) and 3.14:
  cargo fmt, clippy, `cargo test --locked` for both crates, and pytest,
  through the workspace's mise tasks. MISE_PYTHON_VERSION moves a leg off
  the local version, and a step fails the leg if that did not take.
- `wheels`, one abi3-py39 release wheel per protect-ffi platform
  (manylinux 2.28, musllinux 1.2, two Darwin, Windows), each checked by
  filename, imported on 3.9 where the runner matches, uploaded as an
  artifact, with its build time in the job summary; `wheels-summary`
  requires six and writes one table.

No job holds a CS_* credential. Swatinem/rust-cache is on both compiling
jobs.

scripts/__tests__/python-ci.test.mjs holds the workflow to the tree: the
path filter to the workspace's Cargo.lock path dependencies plus the EQL
codegen and catalog, the Python matrix to the floor and the local version,
the wheel matrix to the six platform packages, and every workspace task to
a step that runs it.

Two things the workflow made necessary:

- languages/python/Cargo.lock was stale against the root crates (clww-ore
  0.6.0, vitaminc 0.8.0) and every `--locked` check refused it. Re-seeded
  from the root lock and pruned; no shared crate differs now.
- eql-suite-ci.test.mjs read `mise run test` from any workflow as EQL's
  `test` task. Its scan now counts a `mise run` only from a step whose
  working directory is under packages/eql, with fixture tests.

Also excludes languages/python/** from tests.yml's live gate, records the
push/pull_request asymmetry in workflow-paths-filter-parity.test.mjs, and
updates AGENTS.md and the Python mise.toml notes. No Python lockfile: the
package has no runtime dependency, so only pytest could be locked.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Plain-language pass over the workflow comments, the test comments, and
the AGENTS.md bullet: short sentences, no idioms, and the interpreter
check step named as a sentence. The timeout comment states a fact and
no longer carries an open task.

AGENTS.md now says the Python workspace runs plain `cargo test`, not
nextest, and why: no test there sets an environment variable, and
nextest comes from mise.test.toml, which its CI job does not load.

`triggers(wf)` and `runWorkingDirectory(wf, job, step)` move into
scripts/__tests__/lib/workflows.mjs. shared-test-helpers.test.mjs
rejects a local copy of an exported helper, so the six guards that
carried their own `triggers` switch to the shared one in this commit.

The wheel count is written once, in python-ci.test.mjs. wheels-summary
derives its expected count from its platform list. The clock comment
says what the recorded build time includes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a6212a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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