From 62bcc84d7eaf5060b9ac57929c03036b015ad063 Mon Sep 17 00:00:00 2001 From: Emmanuel Levijarvi Date: Sat, 29 Aug 2026 08:00:37 -0700 Subject: [PATCH 1/2] Run the tests once without the CLI extras The test job runs `tox -e default`, which installs the cli extra, so nothing on a pull request ever exercised an install without click or rich. release.yml installs plain .[testing]. A test module that imported click above its ImportError guard therefore passed every PR check and failed only in the release workflow - after the v9.3.1 tag had been pushed, with the publish job gated behind it. This adds a job that performs the release workflow's install and runs pytest, so that class of failure surfaces on the pull request. It asserts click is genuinely absent first, so the job cannot quietly stop testing what it claims to if the extras change. Build now waits on it. Also drops a dead step from the test job: it pip-installed .[testing] after tox had already run the tests, so it tested nothing. Verified in a venv built the same way: 689 passed, 5 skipped. Claude-Session: https://claude.ai/code/session_01XVj9BYvuLj7Th3iFUVoeCn --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81bb087d..e147b94a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,15 +69,44 @@ jobs: - name: Run tox tests run: tox -e default - - name: Install project testing extras (ensure pytest-asyncio present) + + test-without-cli-extras: + # tox installs the cli extra, so the job above never exercises an + # install without click or rich. release.yml installs plain + # .[testing], and a test module importing click above its + # ImportError guard failed there and nowhere else, after the release + # tag was already pushed. This job runs the release workflow's + # install so that failure surfaces on the pull request instead. + name: Test without CLI extras + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.14' + + - name: Install project with testing extras only run: | python -m pip install --upgrade pip python -m pip install '.[testing]' + - name: Verify the CLI extras really are absent + run: | + if python -c 'import click' 2>/dev/null; then + echo "click is installed; this job no longer tests what it claims to" + exit 1 + fi + + - name: Run tests + run: pytest + build: name: Build Distribution runs-on: ubuntu-latest - needs: [lint, test] + needs: [lint, test, test-without-cli-extras] steps: - uses: actions/checkout@v4 From 706c03c41d654d261cc71ff89f0683f232bccad3 Mon Sep 17 00:00:00 2001 From: Emmanuel Levijarvi Date: Tue, 1 Sep 2026 06:25:21 -0700 Subject: [PATCH 2/2] Mirror the release install exactly in the no-CLI-extras job release.yml installs -e ".[testing]"; this job installed it non-editably and described it as a plain install. Match the install mode, correct the comment, and invoke pytest through the interpreter actions/setup-python configured. Claude-Session: https://claude.ai/code/session_01YDSWT2RqH9T5r7Q4ZUsaEK --- .github/workflows/ci.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e147b94a..ba170d9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,11 +72,12 @@ jobs: test-without-cli-extras: # tox installs the cli extra, so the job above never exercises an - # install without click or rich. release.yml installs plain - # .[testing], and a test module importing click above its - # ImportError guard failed there and nowhere else, after the release - # tag was already pushed. This job runs the release workflow's - # install so that failure surfaces on the pull request instead. + # install without click or rich. release.yml installs + # -e ".[testing]", which has neither, and a test module importing + # click above its ImportError guard failed there and nowhere else, + # after the release tag was already pushed. This job runs the + # release workflow's install so that failure surfaces on the pull + # request instead. name: Test without CLI extras runs-on: ubuntu-latest @@ -91,7 +92,7 @@ jobs: - name: Install project with testing extras only run: | python -m pip install --upgrade pip - python -m pip install '.[testing]' + python -m pip install -e ".[testing]" - name: Verify the CLI extras really are absent run: | @@ -101,7 +102,7 @@ jobs: fi - name: Run tests - run: pytest + run: python -m pytest build: name: Build Distribution