mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Fix for creating a new python virtualenv inside a virtualenv/venv
This fixes a bug similar to that reported in issues #2525 #2503 and #2299.
This commit is contained in:
parent
b1de3338ef
commit
4ca70e1394
1 changed files with 3 additions and 0 deletions
|
|
@ -211,6 +211,9 @@ def install_environment(
|
|||
envdir = prefix.path(helpers.environment_dir(ENVIRONMENT_DIR, version))
|
||||
venv_cmd = [sys.executable, '-mvirtualenv', envdir]
|
||||
python = norm_version(version)
|
||||
# fix for creating a virtualenv inside a virtualenv/venv
|
||||
if python is None and sys.executable != os.readlink(sys.executable):
|
||||
python = os.readlink(sys.executable)
|
||||
if python is not None:
|
||||
venv_cmd.extend(('-p', python))
|
||||
install_cmd = ('python', '-mpip', 'install', '.', *additional_dependencies)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue