diff --git a/pex/tools/commands/README.venv.md b/pex/tools/commands/README.venv.md new file mode 100644 index 000000000..c3f4155dc --- /dev/null +++ b/pex/tools/commands/README.venv.md @@ -0,0 +1,8 @@ +The [Venv](venv.py) command uses the [virtualenv](https://github.com/pypa/virtualenv) project to +suppport creating Python 2.7 virtual environments (The Python `venv` stdlib module was added only +in Python 3). + +We use the last virtualenv version to support Python 2.7, embedding it as the +[virtualenv_16.7.10_py](virtualenv_16.7.10_py) resource via the +[embed_virtualenv.sh](/scripts/embed_virtualenv.sh) script. + diff --git a/scripts/embed_virtualenv.sh b/scripts/embed_virtualenv.sh new file mode 100755 index 000000000..52dc2a6e0 --- /dev/null +++ b/scripts/embed_virtualenv.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +VIRTUALENV_16_7_10_RELEASE_SHA=941d218accf5e8b5672b3c528a73f7d5e2aa18bb + +cd $(git rev-parse --show-toplevel) + +curl --fail -L \ + https://raw.githubusercontent.com/pypa/virtualenv/${VIRTUALENV_16_7_10_RELEASE_SHA}/virtualenv.py \ + > pex/tools/commands/virtualenv_16.7.10_py + diff --git a/tox.ini b/tox.ini index f2336d593..9327a566c 100644 --- a/tox.ini +++ b/tox.ini @@ -181,6 +181,7 @@ deps = tox commands = tox -e vendor + bash scripts/embed_virtualenv.sh git diff --exit-code [testenv:docs]