Skip to content

ci(python-cli): verify clean install of the built wheel (rebased #13416) - #21055

Merged
Git-on-my-level merged 3 commits into
mainfrom
ci/python-cli-clean-install-smoke
Oct 9, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
ci/python-cli-clean-install-smoke

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Based on #13416 by @moon1ight13089703-cmyk — rebased onto current main, preserving their commit authorship.

Supersedes #13416.

omi-cli 0.2.3 shipped to PyPI without click because the publish lane stopped at twine check and the PR lane's pip install -e ".[dev]" hid the missing runtime dependency. This ports the approved clean-install gate:

  • sdks/python-cli/verify-clean-install.sh installs every wheel and sdist in dist/ into a fresh venv, runs omi --version and omi --help, and checks the printed version against that artifact's own METADATA/PKG-INFO.
  • .github/workflows/publish_omi_cli.yml runs that script between twine check and upload-artifact.
  • .github/workflows/python-cli-ci.yml adds install-smoke as its own top-level job (Python 3.10 and 3.12). ci-tier stays first. The job is not nested under windows-acl.

The click pin is already on main (pyproject.toml); the package version is 0.3.0. The script's expected string omi-cli <version> still matches omi --version.

Current main's CI budget rejects a new job until .github/ci-budget.yaml names it. That inventory entry is a second commit on top of the cherry-pick (82b50f46f1, recorded with -x). It is an unsampled sentinel: 5-minute p50, 1 run/day, 10 linux-minutes/day. About 59 linux-minutes of cap headroom remained; a later re-seed at the tests job's ~50 runs/day would need a cap review.

Fork-PR gating

install-smoke runs on fork PRs. It is not behind full_ci.

tests has no needs: ci-tier and no if. windows-acl is the heavy job: it needs: ci-tier and runs only when needs.ci-tier.outputs.full_ci == 'true'. .github/actions/ci-tier/resolve.sh sets full_ci for non-PR events, same-repo PRs, and fork PRs that currently carry ci:full. backend/tests/unit/test_workflow_contracts.py::test_python_cli_fork_deferral_uses_the_standard_notice only requires the existing heavy-CI deferral notice in this workflow; it does not put every job behind full_ci.

install-smoke is secret-free (contents: read, no ${{ secrets.* }}) and cheap (ubuntu-latest, build a wheel, install it, run omi --version / omi --help). That matches the cheap fork-PR lane, including the Windows ACL note in docs/doc/developer/Contribution.mdx, which reserves ci:full for slow guardrails and the Windows Python ACL check.

Test plan

  • Cherry-pick 82b50f46f1 with -x (author moon1ight13089703-cmyk); resolve python-cli-ci.yml so install-smoke is a sibling of windows-acl.
  • actionlint .github/workflows/python-cli-ci.yml .github/workflows/publish_omi_cli.yml
  • python3 .github/scripts/check_ci_budget.py (passed; linux daily budget stays under the cap)
  • pytest --noconftest backend/tests/unit/test_workflow_contracts.py::test_python_cli_fork_deferral_uses_the_standard_notice (1 passed)
  • Local clean-install proof on Python 3.11.15 (Homebrew python3.11). Python 3.10 and 3.12 are not installed on this machine, so those matrix legs were not run locally.
/opt/homebrew/bin/python3.11 -m venv /tmp/omi-cli-clean-install-venv
/tmp/omi-cli-clean-install-venv/bin/pip install --upgrade pip build
cd sdks/python-cli && rm -rf dist
/tmp/omi-cli-clean-install-venv/bin/python -m build
PATH="/tmp/omi-cli-clean-install-venv/bin:$PATH" bash verify-clean-install.sh dist

python -m build produced dist/omi_cli-0.3.0-py3-none-any.whl and dist/omi_cli-0.3.0.tar.gz. The script installed each into its own venv. Both printed omi-cli 0.3.0, matching the artifact metadata, and the fresh installs pulled click==8.5.0 from the declared runtime dependencies.

clean install smoke: ok (dist/omi_cli-0.3.0-py3-none-any.whl, version 0.3.0)
clean install smoke: ok (dist/omi_cli-0.3.0.tar.gz, version 0.3.0)

Product invariants affected

none

Failure-Class: none

View guided diff Turn on auto-fix

moon1ight13089703-cmyk and others added 2 commits October 9, 2026 06:29
Adds a clean-install smoke test that the publish workflow runs before uploading,
so an artifact with a missing or too-loose runtime dependency cannot reach PyPI.
This is the guard proposed in #13410.

Why: the publish workflow validated metadata with twine check but never installed
what it was about to publish, and the PR lane installs -e ".[dev]", where the dev
extras hide a missing runtime dependency. omi-cli 0.2.3 shipped that way - its
metadata omitted click while omi_cli/main.py imports it, pip resolved typer
0.27.2 (which no longer depends on click), and every fresh install failed with
ModuleNotFoundError: No module named 'click'.

The branch is squashed into this single commit because the earlier fix: commit
subject required a failure-class declaration for a correction to code introduced
in the same PR.

(cherry picked from commit 82b50f4)
Current main rejects a new workflow job until the inventory names it with a reviewed rationale. Keep the unsampled sentinel so the remaining linux minute cap still holds.

Co-authored-by: Cursor <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…blish-path triggers

Luna (gpt-6-luna) review of the rebased clean-install gate:
- add Python 3.11 to install-smoke (covers stdlib tomllib path; 3.10 keeps tomli marker)
- verify-clean-install.sh: EXIT-trap venv cleanup, Windows omi.exe fallback, explicit missing-console-script error
- trigger python-cli-ci on publish_omi_cli.yml changes; refresh ci-budget inventory

No blockers found. Workflow contract tests (91) and CI budget check pass locally.
@Git-on-my-level
Git-on-my-level merged commit 5100ad5 into main Oct 9, 2026
58 checks passed
@Git-on-my-level
Git-on-my-level deleted the ci/python-cli-clean-install-smoke branch October 9, 2026 11:05
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.

2 participants