-
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert modernization of virtualenv to fix pants.pex deploy in CI. (#1…
…0343) * Revert "Fix `run_virtualenv` to target the current `$PY`. (#10331)" This reverts commit 206b316. * Revert "Modernize virtualenv. (#10330)" This reverts commit f583d18.
- Loading branch information
Showing
7 changed files
with
90 additions
and
86 deletions.
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
# Wrapper for self-bootstrapping virtualenv | ||
|
||
set -e | ||
|
||
VIRTUALENV_VERSION=16.6.2 | ||
VIRTUALENV_PACKAGE_LOCATION=${VIRTUALENV_PACKAGE_LOCATION:-https://pypi.io/packages/source/v/virtualenv} | ||
|
||
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel) | ||
|
||
# shellcheck source=build-support/common.sh | ||
source "${REPO_ROOT}/build-support/common.sh" | ||
|
||
# Locate the binary's path to log to user or die gracefully if not found. | ||
if command -v "${PY}" >/dev/null; then | ||
PY="$(command -v "${PY}")" | ||
else | ||
die "No ${PY} interpreter found on the path. Python will not work!" | ||
fi | ||
|
||
log "Using python at ${PY}" | ||
|
||
HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
if ! [ -f "${HERE}/virtualenv.dist/BOOTSTRAPPED-${VIRTUALENV_VERSION}" ]; then | ||
pushd "${HERE}" >/dev/null | ||
VIRTUALENV_PACKAGE_FULL_URL="${VIRTUALENV_PACKAGE_LOCATION}/virtualenv-${VIRTUALENV_VERSION}.tar.gz" | ||
log "Downloading ${VIRTUALENV_PACKAGE_FULL_URL}..." | ||
curl -#L -O "${VIRTUALENV_PACKAGE_FULL_URL}" || \ | ||
die "Failed to download ${VIRTUALENV_PACKAGE_FULL_URL}." | ||
rm -rf virtualenv-${VIRTUALENV_VERSION} | ||
tar zxf virtualenv-${VIRTUALENV_VERSION}.tar.gz || \ | ||
die "Failed to extract ${VIRTUALENV_PACKAGE_FULL_URL}." | ||
# TODO(ksweeney): Checksum | ||
touch virtualenv-${VIRTUALENV_VERSION}/BOOTSTRAPPED-${VIRTUALENV_VERSION} && \ | ||
rm -rf virtualenv.dist && \ | ||
mv -f virtualenv-${VIRTUALENV_VERSION} virtualenv.dist | ||
popd >/dev/null | ||
fi | ||
|
||
exec "${PY}" "${HERE}/virtualenv.dist/virtualenv.py" "$@" |