Skip to content

Commit

Permalink
Use Python 3 for subprocesses
Browse files Browse the repository at this point in the history
There is a matrix of what interpreter we use for under-the-hood and what we use for subprocesses. Presumably, when calling `./pants3`, you would expect to also run your tests and subprocesses with Py3.

This change is not only nice-to-have but also required because the native engine does not work when bootstrapped with Python 3 and running a Python 2 subprocess *if* that subprocess uses `native_engine.so`, as several of our tests do.

This may result in conflicts when trying to run Py2-only targets, e.g. python_antlr_library.py. If this is the case, we can resort to pantsbuild#7048 as an alternative solution.
  • Loading branch information
Eric-Arellano committed Jan 9, 2019
1 parent 68ad660 commit 5583d8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pants3
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@

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

# Use Py3 under-the-hood
export PANTS_USE_PYTHON3=true

# Use Py3 for subprocesses
export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["CPython>=3.6,<4"]'

./pants "$@"

0 comments on commit 5583d8c

Please sign in to comment.