Skip to content

Commit

Permalink
Remove build-support/virtualenv; use stdlib venv.
Browse files Browse the repository at this point in the history
Since pants now only runs on Python 3.6+ we can rely on `python -mvenv`
being available and simplify venv creation in our support scripts.

[ci skip-rust-tests]
  • Loading branch information
jsirois committed Jul 11, 2020
1 parent 2b93211 commit 657879d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 48 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ out/
/bin/
/build-support/*.pex
/build-support/virtualenvs
/build-support/virtualenv-*
/build-support/virtualenv.dist/
/build-support/phab/
/build-support/twine-deps.venv/
/dist/
Expand Down
6 changes: 3 additions & 3 deletions build-support/bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ function activate_tmp_venv() {
# place, Shellcheck will not be able to find it so we tell Shellcheck to ignore the file.
# shellcheck source=/dev/null
VENV_DIR=$(mktemp -d -t pants.XXXXX) && \
"${ROOT}/build-support/virtualenv" "$VENV_DIR" && \
source "$VENV_DIR/bin/activate"
"${PY}" -mvenv "${VENV_DIR}" && \
source "${VENV_DIR}/bin/activate"
}

function pre_install() {
Expand Down Expand Up @@ -300,7 +300,7 @@ function activate_twine() {
local -r venv_dir="${ROOT}/build-support/twine-deps.venv"

rm -rf "${venv_dir}"
"${ROOT}/build-support/virtualenv" "${venv_dir}"
"${PY}" -mvenv "${venv_dir}"
# Because the venv/bin/activate script's location is dynamic and not located in a fixed
# place, Shellcheck will not be able to find it so we tell Shellcheck to ignore the file.
# shellcheck source=/dev/null
Expand Down
2 changes: 0 additions & 2 deletions build-support/bin/shellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ def run_shellcheck() -> None:
targets = set(glob("./**/*.sh", recursive=True)) | {
"./pants",
"./build-support/pants_venv",
"./build-support/virtualenv",
"./build-support/githooks/pre-commit",
"./build-support/githooks/prepare-commit-msg",
}
targets -= set(glob("./build-support/bin/native/src/**/*.sh", recursive=True))
targets -= set(glob("./build-support/virtualenv.dist/**/*.sh", recursive=True))
targets -= set(glob("./build-support/twine-deps.venv/**/*.sh", recursive=True))
command = ["shellcheck", "--shell=bash", "--external-sources"] + sorted(targets)
try:
Expand Down
2 changes: 1 addition & 1 deletion build-support/pants_venv
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function remove_venv() {

function create_venv() {
remove_venv
"${REPO_ROOT}/build-support/virtualenv" "$(venv_dir)"
"${PY}" -mvenv "$(venv_dir)"
}

function ensure_gcc() {
Expand Down
40 changes: 0 additions & 40 deletions build-support/virtualenv

This file was deleted.

0 comments on commit 657879d

Please sign in to comment.