fix(hooks): use the Windows virtualenv interpreter - #3710
Open
audmartina9 wants to merge 2 commits into
Open
Conversation
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.
On Windows, the pre-commit hook creates
.venv/Scripts/python.exebut then tries to install dependencies using.venv/bin/python, which raisesFileNotFoundErrorbefore validation starts. Select the Windows interpreter path onos.name == "nt"and keep the existing POSIX path elsewhere.Adds one offline integration test that exercises the hook's dependency branch using a real virtual environment, an empty requirements file, and three fixture validators. Each validator asserts that it runs inside a virtual environment. Downloads and index checkout are replaced with local fixtures; the interpreter and pip calls are real.
Validation on Windows:
FileNotFoundErrorat upstream commit168495987009158d811c7bb41a3bb4b65d9a7a80using the same offline fixture approach.python -m unittest discover -s git-hooks -p test_pre_commit_venv.py -v— passed (1 test).git diff --check— passed before commit.Prepared and tested with an AI coding assistant under the account holder's authorization. If this tooling fix is eligible for a discretionary USDC/USDT contributor reward, please assess it under the project's rules. I understand that the published per-cell data reward and schema-DBIP reward do not automatically cover this repair; no payment has been agreed or is being claimed as owed.
If this tooling contribution qualifies for a reward, Ethereum mainnet receiving address:
0xb45A8D75cDf5C85c15d046D6ceA826Db4c034C61.