-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prepend virtualenv path rather than append (#1751)
prepend all virtualenv PATHs so the most nested directory is at the front of the vector. otherwise the most globally configured virtualenv takes precedence add unit tests and e2e tests to verify this change
- Loading branch information
1 parent
8dcf9d2
commit 5c9e82e
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,23 @@ assert_contains "mise x [email protected] -- python --version" "Python 3.12.0" | |
assert_contains "mise env -s bash | grep VIRTUAL_ENV" "$MISE_DATA_DIR/venv" | ||
assert "mise x -- which python" "$MISE_DATA_DIR/venv/bin/python" | ||
|
||
# verify nested virtualenv is used | ||
mkdir -p subdir | ||
cat >subdir/.e2e.mise.toml <<EOF | ||
[env._.python] | ||
venv = {path = "{{env.MISE_DATA_DIR}}/subvenv", create=true} | ||
[tools] | ||
python = "{{exec(command='echo 3.12.0')}}" | ||
EOF | ||
|
||
cd subdir | ||
mise i | ||
assert_contains "mise x [email protected] -- python --version" "Python 3.12.0" | ||
assert_contains "mise env -s bash | grep VIRTUAL_ENV" "$MISE_DATA_DIR/subvenv" | ||
assert "mise x -- which python" "$MISE_DATA_DIR/subvenv/bin/python" | ||
|
||
rm -rf subdir | ||
|
||
if [ "${TEST_ALL:-}" != 1 ]; then | ||
exit | ||
fi | ||
|
This file contains 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