Is there a way to opt out of generating pex files ...
# general
s
Is there a way to opt out of generating pex files during development* when trying to run scripts / modules? Unfortunately I have some large dependencies like scipy, etc, and whenever I make a slight change to a first party library (like add a print) it takes a really long time for
./pants run foo:cli
to run. Having
Building foo/cli.pex with 20 requirements:...
take 20 seconds really kills being able to establish a fast feedback loop
w
are you running a
pex_binary
target, or a
python_source
target? as of relatively recently, those have different implementations.
s
I'm targeting a
pex_binary
I actually didn't know I could target a python_source
This seems to solve my problem
For what its worth https://www.pantsbuild.org/docs/python-run-goal says Run a
pex_binary
target and I guess I kind of stopped reading there lol
As the next couple lines say I can target a
pex_binary
or
python_source
đź‘Ť 1
Thanks
w
sorry for the trouble. running a
pex_binary
used to use the same optimization, so it wouldn’t have mattered which you ran. but there are technically some potential behavior differences in this optimization, so we decided to have running a
pex_binary
always fully create the PEX (like
package
would) before `run`ning it
b
Also, if/when you DO need a PEX binary, the default layout of zipapp usually causes these long building times for substantial libraries. Changing to one of the other modes is ideal
s
That's good to know. I had tried messing around with
execution_mode
but not
layout