hundreds-father-404
02/16/2021, 11:07 PM652df2c
works when running ./pants lint src/python/pants/util/*.py
, but master branch fails with:enough-analyst-54434
02/16/2021, 11:45 PMhundreds-father-404
02/16/2021, 11:46 PM--venv
mode, not --unzip
and zip appenough-analyst-54434
02/16/2021, 11:48 PMpex -c black black==20.b1 --venv -o black.pex
PEX_TOOLS=1 ./black.pex venv black.venv
black.venv/bin/black pex/*.py
__main__
- the bin scripts in a venv all have a __name__
guard on __main__
.witty-crayon-22786
02/17/2021, 12:38 AMenough-analyst-54434
02/17/2021, 12:39 AMpex ..
foo on that ticketwitty-crayon-22786
02/17/2021, 12:41 AMhundreds-father-404
02/17/2021, 12:42 AM--interpreter-constraint='CPython==3.9.*'
for the Pex command and PANTS_BLACK_INTERPRETER_CONSTRAINTS='["CPython>=3.9"]'
for Pantswitty-crayon-22786
02/17/2021, 12:42 AMenough-analyst-54434
02/17/2021, 12:42 AMrm -rf ~/.pex/isolated
witty-crayon-22786
02/17/2021, 12:43 AMenough-analyst-54434
02/17/2021, 12:44 AMYay, your Pants Pex fixes it!Eric - the PR fixes it or the
PEX_TOOLS=1 ...
experiment?witty-crayon-22786
02/17/2021, 12:44 AM$ ~/src/venvs/pex-2.1.30/bin/pex -c black black==20.8b1 --interpreter-constraint='CPython==3.9.*' --venv -o black.pex
$ PEX_TOOLS=1 ./black.pex venv black.venv
$ black.venv/bin/black ~/src/pex/**/*.py
All done! ✨ 🍰 ✨
61 files left unchanged.
enough-analyst-54434
02/17/2021, 12:45 AM__name__ == '__main__'
issue.hundreds-father-404
02/17/2021, 12:46 AMenough-analyst-54434
02/17/2021, 12:48 AMhundreds-father-404
02/17/2021, 12:53 AMenough-analyst-54434
02/17/2021, 12:54 AMif __name__ != '__main__':
return
hundreds-father-404
02/17/2021, 1:00 AM11 if __name__ != "__main__":
12 sys.exit(0)
Resulting in:
error: cannot format /private/var/folders/hm/qjjq4w3n0fsb07kp5bxbn8rw0000gn/T/process-executionAkW4J8/src/python/pants/pantsd/pants_daemon.py: A process in the process pool was terminated abruptly while the future was running or pending.
This is on the master branch.
Lmk if it'd be helpful to VC about thisenough-analyst-54434
02/17/2021, 1:12 AMif __name__ == '__main__':
guard just under the shebang an indent the whole file under that.hundreds-father-404
02/17/2021, 1:17 AMHow about just try a vanilla if name == '__main__': guard just under the shebang an indent the whole file under that.
enough-analyst-54434
02/17/2021, 1:17 AMfor py in python3.{8,9}; do echo -n "$py: " && $py -c 'import multiprocessing; print(multiprocessing.get_start_method())'; done
python3.8: fork
python3.9: fork
You should see a spawn
for python3.9.hundreds-father-404
02/17/2021, 1:49 AMenough-analyst-54434
02/17/2021, 1:54 AM