Repository navigation
Stop the virtualenv check failing a fresh clone's first command - #18
Merged
Merged
Conversation
Found by cloning the published repo the way a stranger does, running
`python3 -m venv myenv` in it, and typing `python3 smoke_test.py`. The only
failure was a check added hours earlier, which asserted that EVERY directory
holding a pyvenv.cfg is gitignored, "whatever its name".
That is a promise .gitignore cannot keep — a glob cannot recognise a
virtualenv — so the check demanded something no pattern set can satisfy and
greeted a reasonable first command with a red suite. A guard somebody has to
argue with on their first command is one they learn to suppress, and the next
real finding goes with it.
The hard assertion now covers what the project can promise: the virtualenv
names its own instructions lead people to. An unexpected name gets one line
of output saying what would happen and how to fix it.
Two things inside the check were also wrong, and both passed for the wrong
reason:
* git check-ignore matches a trailing-slash pattern only against something
it can see IS a directory, so asking about a name absent from this
checkout answered "not ignored" for five of the seven names the check had
just been written to cover. It probes a path INSIDE the directory now.
* git check-ignore skips TRACKED paths by default, and .env.example is
tracked, so the assertion that it stays visible could never fail. Caught
by removing the !.env.example negation and watching the suite stay green.
It passes --no-index now.
Two faults planted, suite red on a named check for each.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fix to a check I added in #17, found by the one thing that keeps finding this class of bug: cloning the published repo the way a stranger does and typing the commands the README gives them.
The only failure was a check added hours earlier:
Why the check was wrong, not the clone
It asserted that every directory holding a
pyvenv.cfgis gitignored, "whatever its name". That is a promise.gitignorecannot keep — a glob cannot recognise a virtualenv — so the check demanded something no pattern set can satisfy, and greeted a perfectly reasonable first command with a red suite.That is the failure this suite exists to avoid rather than to cause. A guard somebody has to argue with on their first command is one they learn to suppress, and the next real finding goes with it.
The hard assertion now covers what the project can actually promise: the virtualenv names its own instructions lead people to (
.venv,venv,env, and the-enginesuffix forms the "one virtualenv per engine" advice produces). An unexpected name gets one line of output instead of a failure:Two things inside the check that passed for the wrong reason
Both are worth naming, because a green check that cannot fail is the thing this repo keeps being bitten by.
git check-ignorematches a trailing-slash pattern only against something it can see IS a directory. Asking about a name that does not exist in this checkout therefore answers "not ignored" for every pattern that would in fact cover it — five of the seven names the check had just been written to cover. It probes a path inside the directory now (<name>/pyvenv.cfg).git check-ignoreskips TRACKED paths by default, and.env.exampleis tracked. So the assertion that it stays visible could never fail, whatever the patterns said. Caught by planting the fault — commenting out the!.env.examplenegation — and watching the suite stay green. It passes--no-indexnow, and with that the same fault turns it red.Verification
Two faults planted, suite red on a named check for each:
a virtualenv called .venv-playwright/ would be ignored(+2).env.examplebecomes ignored by a too-broad rule...and .env.example is still NOT ignoredAnd the scenario that started this: the same fresh clone, same
myenv, now green with the note.Separately — the canary dispatched after #17 merged ran both jobs and passed, so the new cross-engine job is verified on the default branch rather than only written.
🤖 Generated with Claude Code