Skip to content

Run the tests once without the CLI extras - #128

Merged
eman merged 2 commits into
mainfrom
ci/test-without-cli-extras
Sep 1, 2026
Merged

Run the tests once without the CLI extras#128
eman merged 2 commits into
mainfrom
ci/test-without-cli-extras

Conversation

@eman

@eman eman commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Why

The test job runs tox -e default, and tox.ini lists extras = cli, testing — so click and rich are always present on a pull request. release.yml installs -e ".[testing]", which has neither.

That gap has already cost a release. A test module in #122 imported click.testing above the try/except ImportError guard that lets it skip without the CLI extras. Every PR check passed. The v9.3.1 release workflow then failed at Run tests with ModuleNotFoundError: No module named 'click' — after the tag was pushed, with the publish job gated behind it. Recovering meant fixing the import, deleting the tag and re-pushing it.

Nothing on a PR can currently catch that.

What

A Test without CLI extras job that performs the release workflow's install and runs pytest. build now waits on it alongside lint and test.

It verifies click is genuinely absent before running, so if the extras are ever restructured such that click arrives anyway, the job fails loudly rather than quietly going back to testing the same thing as test.

Also drops a dead step from test: it pip-installed .[testing] after tox had already run the tests, so it tested nothing.

Verified

In a venv built the same way (pip install -e '.[testing]', no click): 689 passed, 5 skipped — the CLI modules skip as designed. Against the pre-fix import, the same env produced the collection error the release hit.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new job’s documentation and install/test invocation should be aligned with the release workflow to ensure it truly mirrors the intended release-path behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds CI coverage for the “release-style” installation path that omits the cli extra, so PR checks can catch tests (or test imports) that accidentally require click/rich even when they should be optional.

Changes:

  • Adds a new Test without CLI extras job that installs .[testing], asserts click is absent, and runs pytest.
  • Updates the build job to depend on the new job in addition to lint and test.
  • Removes a dead post-tox install step from the test job (it previously installed after tests had already run).
File summaries
File Description
.github/workflows/ci.yml Adds a new CI job to run pytest without CLI extras and gates build on its success.
Review details

Suppressed comments (1)

.github/workflows/ci.yml:94

  • This job is intended to replicate the release workflow install, but it currently does a non-editable install (pip install '.[testing]') while release.yml uses an editable install. Using the same install mode helps ensure the job catches the same class of failures as the release workflow.
          python -m pip install --upgrade pip
          python -m pip install '.[testing]'
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment on lines +75 to +79
# 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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 706c03c — the job now runs python -m pytest.

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
@eman
eman merged commit 8ec21f4 into main Sep 1, 2026
8 checks passed
@eman
eman deleted the ci/test-without-cli-extras branch September 1, 2026 13:27
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