Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
[virtualenv] Use config file rather than env var to set Python
Browse files Browse the repository at this point in the history
Prior to this change, we used an env var to select the python version to
use. This takes precedence over the version passed as a CLI option (see
pypa/virtualenv#2285) so breaks thing like nox.

This change switches to putting the config in a config file instead.
  • Loading branch information
samueljsb committed Aug 10, 2023
1 parent 0935218 commit 777b729
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions configfiles/virtualenv.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenv]
python = python3.11,python3.10,python3.9,python3.8
1 change: 1 addition & 0 deletions qaz_modules/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Python(Bundle):
".pypirc": "~",
"pythonstartup.py": "~/.config/",
".pdbrc.py": "~",
"virtualenv.ini": "~/.config/",
}

def post_install(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion zshrc/python.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export PIP_REQUIRE_VIRTUALENV=1

alias python=python3

export VIRTUALENV_PYTHON=python3.11,python3.10,python3.9,python3.8
export VIRTUALENV_CONFIG_FILE="$XDG_CONFIG_HOME/virtualenv/virtualenv.ini"

alias zen="python -c 'import this'"

Expand Down

0 comments on commit 777b729

Please sign in to comment.