Skip to content

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

Closed
moon1ight13089703-cmyk wants to merge 1 commit into
BasedHardware:mainfrom
moon1ight13089703-cmyk:ci/omi-cli-install-smoke
Closed

moon1ight13089703-cmyk wants to merge 1 commit into
BasedHardware:mainfrom
moon1ight13089703-cmyk:ci/omi-cli-install-smoke

Conversation

@moon1ight13089703-cmyk

@moon1ight13089703-cmyk moon1ight13089703-cmyk commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

ci(python-cli): gate releases on a clean-install smoke test

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 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 (no longer depending on click), and every fresh install
failed with ModuleNotFoundError: No module named 'click'.

What it does:

  • sdks/python-cli/verify-clean-install.sh installs every artifact in the dist
    directory into a clean venv, runs the console script, and cross-checks the
    version it prints against the version that artifact declares in its own
    metadata (wheel *.dist-info/METADATA, sdist PKG-INFO).
  • .github/workflows/publish_omi_cli.yml runs it between twine check and
    the artifact upload; the publish job's permissions are untouched.
  • .github/workflows/python-cli-ci.yml adds an install-smoke job on 3.10
    and 3.12, because 3.10 selects an extra runtime dependency (tomli) through
    an environment marker.

Verification

  • Local: �ash verify-clean-install.sh dist against both artifacts built from
    main - wheel and sdist install into clean venvs, resolve typer 0.25.1 with
    click 8.5.0 present, print omi-cli 0.3.0, and pass the new version cross-check.
  • CI on the previous head already ran the new gate: Clean install smoke
    (Python 3.10)
    and (Python 3.12) both passed, alongside Linux 3.10/3.12 and
    Windows ACL.
  • python .github/scripts/pr_preflight.py --lane local passes for this diff
    except workflow-apt-network-bounds, which cannot build webrtcvad locally on
    Windows (no MSVC); it passed in CI on the previous head.

Bounty

Proposed US bounty per the contribution guide - see #13410.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 5/5

  • sdks/python-cli/verify-clean-install.sh lacks the executable bit, so the documented ./verify-clean-install.sh [dist-dir] invocation fails with a permission error; set the file mode to executable.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdks/python-cli/verify-clean-install.sh">

<violation number="1" location="sdks/python-cli/verify-clean-install.sh:1">
P3: The new script is checked in without the executable bit (mode -rw-r--r--), so running it the way the header documents (`verify-clean-install.sh [dist-dir]`, i.e. `./verify-clean-install.sh`) fails with Permission denied. The sibling release.sh is executable (-rwxr-xr-x), so this is a convention mismatch. CI is unaffected because both workflows invoke it via `bash verify-clean-install.sh`, but add `chmod +x sdks/python-cli/verify-clean-install.sh` so direct invocation works as documented.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread sdks/python-cli/verify-clean-install.sh Resolved
Comment thread .github/workflows/python-cli-ci.yml Resolved
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The new script is checked in without the executable bit (mode -rw-r--r--), so running it the way the header documents (verify-clean-install.sh [dist-dir], i.e. ./verify-clean-install.sh) fails with Permission denied. The sibling release.sh is executable (-rwxr-xr-x), so this is a convention mismatch. CI is unaffected because both workflows invoke it via bash verify-clean-install.sh, but add chmod +x sdks/python-cli/verify-clean-install.sh so direct invocation works as documented.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At sdks/python-cli/verify-clean-install.sh, line 1:

<comment>The new script is checked in without the executable bit (mode -rw-r--r--), so running it the way the header documents (`verify-clean-install.sh [dist-dir]`, i.e. `./verify-clean-install.sh`) fails with Permission denied. The sibling release.sh is executable (-rwxr-xr-x), so this is a convention mismatch. CI is unaffected because both workflows invoke it via `bash verify-clean-install.sh`, but add `chmod +x sdks/python-cli/verify-clean-install.sh` so direct invocation works as documented.</comment>

<file context>
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+#
+# Install the built wheel into a clean environment and run the console script.
</file context>

@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

All three findings are fixed in 5f7f06c:

  1. verify-clean-install.sh now loops over every artifact in the dist directory, so the sdist is installed and started in a clean environment too (verified locally: both omi_cli-0.3.0-py3-none-any.whl and omi_cli-0.3.0.tar.gz install and run).
  2. The install-smoke job is now a 3.10/3.12 matrix. You were right that 3.10 selects an extra runtime dependency (tomli, via python_version < '3.11'), which the 3.12-only job could not cover.
  3. The helper is now mode 100755, matching release.sh.

Thanks - the sdist gap in particular was a real hole in the guard.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — the motivation checks out. I verified against PyPI that omi-cli 0.2.3's requires_dist indeed omits click while omi_cli/main.py imports it, and that main already carries the pyproject.toml fix, so a release gate is exactly the right complement. The three earlier findings are all addressed on this head: the artifact loop in sdks/python-cli/verify-clean-install.sh now covers the sdist, the install-smoke job in .github/workflows/python-cli-ci.yml runs on both 3.10 and 3.12 (3.10 selects tomli via the environment marker), and the script is mode 100755. The step placement in .github/workflows/publish_omi_cli.yml (immediately after twine check, before the artifact upload) is the right spot.

One blocking bug, found by running the script from this branch on Linux.

verify-clean-install.sh picks the venv binary directory before creating the venv:

venv_dir="$(mktemp -d)"
venv_bin="$venv_dir/bin"
if [ ! -d "$venv_bin" ]; then
  venv_bin="$venv_dir/Scripts"
fi

python -m venv "$venv_dir"

mktemp -d returns an empty directory, so bin/ never exists at detection time and the fallback always selects Scripts/, which only exists on Windows venvs. On Linux every iteration dies before installing anything:

verify-clean-install.sh: line 41: /tmp/tmp.*/Scripts/python: No such file or directory   (exit 127)

Both new gates run on ubuntu-latest, so the PR can't go green as posted — and this also explains why a local run may have passed on a Windows machine while failing on POSIX CI.

Fix: create the venv first, then detect:

venv_dir="$(mktemp -d)"
python -m venv "$venv_dir"
if [ -d "$venv_dir/bin" ]; then
  venv_bin="$venv_dir/bin"
else
  venv_bin="$venv_dir/Scripts"
fi

With that ordering I ran the corrected script end-to-end against artifacts built from this branch: both the omi_cli-0.3.0 wheel and sdist install into clean venvs, resolve typer 0.25.1 with click 8.5.0 present, and omi --version prints omi-cli 0.3.0.

One CI note: the workflows on this branch are currently action_required pending first-time fork-workflow approval, so the new job hasn't exercised this yet — worth approving the run once the fix is pushed so the gate proves itself before merge.

Leaving the formal merge decision to a maintainer since this wires a new gate into the PyPI publish workflow.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-maintainer-review Needs a human maintainer to sign off before merge docs-tooling Layer: Documentation, examples, dev tools labels Sep 10, 2026
@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

Caught a real bug - thank you. Fixed in e5fd492.

You were exactly right about the root cause: mktemp -d returns an empty directory, so probing bin/ before python -m venv ran meant the Scripts/ fallback always won, and every POSIX run died at the first install step. My local run passed because this machine is Windows, where Scripts/ is the correct layout - a good reminder that a green local run on the wrong platform is not evidence.

The fix creates the venv first and then detects the layout, matching your snippet, plus it now fails loudly if neither layout provides an interpreter. Verification on this head:

  • A layout check over both directories: bin/ layout selects bin, Scripts/ layout selects Scripts.
  • The full helper against artifacts built from this branch: wheel and sdist both install into clean venvs, typer 0.25.1 with click 8.5.0 present, omi --version prints omi-cli 0.3.0, exit 0.

Agreed on letting the new job prove itself: once the workflow run is approved, install-smoke on 3.10 and 3.12 is the real evidence - and if it still fails, that is a defect in the gate, not in your review.

@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

@josancamon19 @kodjima33 - the blocking bug the review found is fixed in e5fd492: the helper now creates the venv before detecting its layout (verified for both bin/ and Scripts/ layouts, and end-to-end against the wheel and the sdist). The new install-smoke job can only prove itself once this first-time fork contribution's workflow run is approved - that approval is the one step I cannot do from here. Nothing else is outstanding on my side.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified on Linux at e5fd492 — I ran the head's helper end to end against a wheel built from current main (identical package content, since this PR changes no Python package code):

  • sdks/python-cli/verify-clean-install.sh — layout detection now runs after python -m venv, and the script fails loudly if neither bin/ nor Scripts/ yields an interpreter. The clean venv resolved typer 0.25.1 with click 8.5.0 present, omi --version printed omi-cli 0.3.0, exit 0. The POSIX exit-127 bug from my earlier review is gone.
  • .github/workflows/python-cli-ci.yml — the install-smoke job (3.10/3.12 matrix on ubuntu-latest, job-level defaults.run.working-directory: sdks/python-cli makes bash verify-clean-install.sh dist resolve correctly) is the right PR-time complement to the editable-install tests job, and the 3.10 leg covers the tomli environment-marker dependency.
  • .github/workflows/publish_omi_cli.yml — the step sits between twine check and the artifact upload in the build job, so an artifact that installs broken can no longer reach the publish job. Permissions are untouched (id-token: write remains scoped to the publish job only).

I've dismissed my earlier changes-requested review — its blocking concern is fixed on this head.

One step remains that only maintainers can do: the fork's workflow runs are action_required pending first-time workflow approval, so install-smoke hasn't executed on CI yet. Approving the run lets the new gate prove itself before merge.

Leaving merge sign-off to a human maintainer: this wires a new gate into the PyPI publish workflow.


by AI on behalf of David

@Git-on-my-level
Git-on-my-level dismissed their stale review September 11, 2026 08:12

Dismissed: the blocking POSIX venv-layout bug (layout detected before venv creation, forcing the Windows-only Scripts/ fallback and exit 127 on Linux) is fixed at e5fd492 — venv is created first, layout detected after, loud failure if no interpreter is found. Verified by running the head script end to end on Linux: clean install resolves typer 0.25.1 with click 8.5.0, omi --version exits 0.

@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

Thanks for re-running it on Linux and for dismissing the earlier request - the exit-127 trace in your first review was the most useful thing that happened to this PR, and the verification that the fix holds on POSIX is exactly the evidence I could not produce from a Windows machine.

Understood on the remaining step: the workflow run approval and the merge sign-off are maintainer actions, and the install-smoke job will prove the gate on its first real CI run.

@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

Folded in the one substantive extra that #13494 had and this guard lacked, after the review compared the two: the version the entry point prints is now cross-checked against the version each artifact declares in its own metadata (wheel *.dist-info/METADATA, sdist PKG-INFO), so a stale or drifted declared version cannot ship silently.

Verified locally on this head against both artifacts built from main: wheel and sdist install into clean venvs, resolve typer 0.25.1 with click 8.5.0 present, print omi-cli 0.3.0, and the new check passes with exit 0.

That leaves the two PRs differing mainly in shape, as the review noted: this one keeps the smoke as its own 3.10/3.12 CI lane (the 3.10 leg is what covers the tomli environment marker) and stays a single small script; #13494 packs more logic into one script. Both are verified now - the shape choice is the maintainers'. If they prefer a single combined script, I am happy to fold, and equally happy to withdraw.

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 BasedHardware#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.
@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

The previous head failed the Hygiene job on exactly one check, and it was about this PR's history rather than its code: failure-class-protocol requires a Failure-Class: declaration in the PR body for any commit whose subject starts with fix:, and this branch carried a fix: commit correcting code introduced in the same PR. Rather than declare a failure class for a same-PR correction, I squashed the branch into a single ci(...) commit: still three files, one commit, and no content change relative to the previous head. The PR body now documents the change and the verification.

Worth recording for the review, because it is the evidence the earlier review asked for: on the previous head the new gate ran on real CI - Clean install smoke (Python 3.10) and (Python 3.12) both passed, with Linux 3.10/3.12 and Windows ACL green alongside them. The only red check was the hygiene one above, which this squash resolves.

@Git-on-my-level

Copy link
Copy Markdown
Member

Update on the squashed head (82b50f46) — both changes since the last review check out, and the new gate has now proven itself on real CI:

  • sdks/python-cli/verify-clean-install.sh — the folded-in version cross-check is the substantive addition. artifact_version() reads the declared version from each artifact's own metadata (wheel *.dist-info/METADATA, sdist PKG-INFO), the loop fails loudly when no Version: line is present, and the final expected_version="omi-cli $declared_version" comparison catches an artifact whose declared version drifts from what the installed console script actually prints. Ordering is right: the drift check only runs after omi --version/--help have already succeeded in the clean venv, so a drift failure cannot mask an install failure. The quoted heredoc delimiter keeps the embedded Python literal-safe under set -euo pipefail.
  • .github/workflows/python-cli-ci.yml — the install-smoke matrix has now executed on this head: both Clean install smoke legs (3.10 and 3.12) are green, so the tomli environment-marker leg that motivated the matrix is covered on CI, not just locally. The workflow-level working-directory: sdks/python-cli default still makes bash verify-clean-install.sh dist resolve correctly, and building only the wheel here is fine — the sdist leg is exercised by the publish workflow's full python -m build.
  • .github/workflows/publish_omi_cli.yml — content unchanged on this head; the step still sits between twine check and the artifact upload so a bad artifact can no longer reach the publish job, and id-token: write remains scoped to the publish job only.

The squash into a single ci(...) commit resolves the Hygiene failure-class requirement without content change; Hygiene is green on this head alongside the Linux 3.10/3.12 and Windows ACL lanes.

The technical review is complete on my side — thank you for the fast, thorough iterations across all three rounds. What remains is maintainer territory: the shape choice between this PR and #13494 (you've generously offered to fold or withdraw), and merge sign-off for wiring a new gate into the PyPI publish path.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added the positive-signal Automation verified a genuine fix/quality contribution label Sep 12, 2026

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on 82b50f4.

verify-clean-install.sh installs each built wheel/sdist into a clean venv and checks the console script version against that artifact's metadata. CI runs it on 3.10 and 3.12; publish runs it after twine. That is the 0.2.3 click/typer hole.

This touches .github/workflows/** (CODEOWNERS @Git-on-my-level). My approve is not a fake David CODEOWNERS review. I am not merging.

@moon1ight13089703-cmyk

Copy link
Copy Markdown
Contributor Author

@aryanorastar thanks for verifying the head, and for being explicit about the boundary - "my approve is not a fake David CODEOWNERS review, I am not merging" is exactly the useful kind of answer.

Two things that may help whoever handles the override, since 82b50f46 is mergeable and blocked only on .github/workflows/**:

@Git-on-my-level - escalating with need human response as your review footer instructed. This PR is blocked on the .github/workflows/** CODEOWNERS entry, which is you. The specific question is whether you want anything from me before the owner review: a shorter diff, or the workflow change split out from the script so the CODEOWNERS surface is smaller? Either is fine to do - I would just rather ask than keep the PR sitting in blocked for a week.

Nothing else is outstanding on my side. Preflight is green, the branch is one commit, and the script's own bug (venv layout detected before python -m venv) was fixed and independently re-run on Linux.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Approval on 82b50f46f1 still stands.

Clean-install smoke is green on 3.10 and 3.12 at this head. #13494 is closed, so this is the remaining vehicle for #13410.

This still touches .github/workflows/**. My approve is not a CODEOWNERS review. I am not merging.

Git-on-my-level added a commit that referenced this pull request Oct 9, 2026
Gate PyPI publishes and CI on a clean venv install of every built wheel + sdist, cross-checking the CLI's printed version against the artifact's own metadata.

Based on #13416 by @moon1ight13089703-cmyk — rebased onto the post-#19780 workflow, preserving their commit authorship. Fixes the class of release where omi-cli 0.2.3 shipped without its runtime click dependency while dev-extra installs masked it.

Review hardening (Luna / gpt-6-luna): Python 3.11 added to the smoke matrix (stdlib tomllib path), venv cleanup trap + Windows omi.exe fallback in the script, publish-workflow path triggers, ci-budget inventory refresh.

Co-authored-by: moon1ight13089703-cmyk <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member

Superseded by #21055 (merged): your clean-install gate is now on main — the verify script, the CI smoke job (now covering Python 3.10/3.11/3.12), and the pre-publish gate between twine check and upload. Your commit authorship is preserved in the squash history. Thanks @moon1ight13089703-cmyk — this closes out the omi-cli 0.2.3 missing-dependency class.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Hey @moon1ight13089703-cmyk 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-tooling Layer: Documentation, examples, dev tools needs-maintainer-review Needs a human maintainer to sign off before merge positive-signal Automation verified a genuine fix/quality contribution workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants