<#2001 The PEX_TOOLS venv `--compile` option shoul...
# github-notifications
q
#2001 The PEX_TOOLS venv `--compile` option should ignore compile errors. Issue created by jsirois If there is a compile error, it may be irrelevant as in this case https://github.com/ShantanuKumar/pants-multi-poetry. There the PEX produced via
./pants package src/package-a/package_a:pex_package_a
runs into this issue:
Copy code
$ PEX_TOOLS=1 python3.9 dist/src.package-a.package_a/pex_package_a.pex venv --scope=deps --compile ./pex-deps-compiled 2>&1 | grep -C5 SyntaxError
Compiling './pex-deps-compiled/lib/python3.9/site-packages/aenum/__init__.py'...
Compiling './pex-deps-compiled/lib/python3.9/site-packages/aenum/_py2.py'...
***   File "./pex-deps-compiled/lib/python3.9/site-packages/aenum/_py2.py", line 5
    raise exc, None, tb
             ^
SyntaxError: invalid syntax

Compiling './pex-deps-compiled/lib/python3.9/site-packages/aenum/_py3.py'...
Listing './pex-deps-compiled/lib/python3.9/site-packages/aenum/doc'...
Compiling './pex-deps-compiled/lib/python3.9/site-packages/aenum/test.py'...
Compiling './pex-deps-compiled/lib/python3.9/site-packages/aenum/test_v3.py'...
The
aenum/_py2.py
file will never get imported by the Python 3.9 interpreter; so this compile failure is not relevant. If the compile error is real, the application will encounter it at runtime and fail anyhow. On balance, it seems a later warning is by far the lesser of two evils here. Currently failing the venv creation due to failing compilation of a file stops things in their tracks with no recourse. pantsbuild/pex