Repository navigation
ci(python-cli): verify clean install of the built wheel - #13416
moon1ight13089703-cmyk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 5/5
sdks/python-cli/verify-clean-install.shlacks 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
| @@ -0,0 +1,43 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
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>
|
All three findings are fixed in 5f7f06c:
Thanks - the sdist gap in particular was a real hole in the guard. |
Git-on-my-level
left a comment
There was a problem hiding this comment.
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"
fiWith 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.
|
Caught a real bug - thank you. Fixed in e5fd492. You were exactly right about the root cause: 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:
Agreed on letting the new job prove itself: once the workflow run is approved, |
|
@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. |
|
Verified on Linux at e5fd492 — I ran the head's helper end to end against a wheel built from current
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 Leaving merge sign-off to a human maintainer: this wires a new gate into the PyPI publish workflow. by AI on behalf of David |
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.
|
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. |
|
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.
0fab340 to
82b50f4
Compare
|
The previous head failed the Hygiene job on exactly one check, and it was about this PR's history rather than its code: 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. |
|
Update on the squashed head (
The squash into a single 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 |
aryanorastar
left a comment
There was a problem hiding this comment.
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.
|
@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
@Git-on-my-level - escalating with need human response as your review footer instructed. This PR is 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 |
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]>
|
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 |
|
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:
Before your next PR, please skim:
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! |
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 checkbut neverinstalled 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
clickwhileomi_cli/main.pyimports it, pipresolved 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.shinstalls every artifact in the distdirectory 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, sdistPKG-INFO)..github/workflows/publish_omi_cli.ymlruns it betweentwine checkandthe artifact upload; the publish job's permissions are untouched.
.github/workflows/python-cli-ci.ymladds aninstall-smokejob on 3.10and 3.12, because 3.10 selects an extra runtime dependency (
tomli) throughan environment marker.
Verification
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.
(Python 3.10) and (Python 3.12) both passed, alongside Linux 3.10/3.12 and
Windows ACL.
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.