Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ./pants2 overriding desired $PY interpreter #7338

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build-support/bin/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ export PANTS_DEV=1
# and `./pants2`, so those scripts cannot set the relevant environment variables.
if [[ "${python_two:-false}" == "false" ]]; then
py_major_minor="3.6"
bootstrap_pants_script="./pants"
else
py_major_minor="2.7"
bootstrap_pants_script="./pants2"
fi
export PY="${PY:-python${py_major_minor}}"

Expand All @@ -133,7 +131,7 @@ if [[ "${run_bootstrap:-false}" == "true" ]]; then
if [[ "${run_bootstrap_clean:-false}" == "true" ]]; then
./build-support/python/clean.sh || die "Failed to clean before bootstrapping pants."
fi
${bootstrap_pants_script} binary \
./pants binary \
src/python/pants/bin:pants_local_binary && \
mv dist/pants_local_binary.pex pants.pex && \
./pants.pex -V
Expand Down
2 changes: 1 addition & 1 deletion pants2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# This bootstrap script invokes Pants using a Python 2 interpreter.

export PY="python2.7"
export PY="${PY:-python2.7}"

# Allow spawned subprocesses, such as unit tests, to execute with either Python 2 and Python 3.
# So long as the target does not have a compatibility constraint that requires only Python 3, the
Expand Down