https://pantsbuild.org/ logo
s

silly-queen-7197

03/11/2023, 12:26 AM
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

witty-crayon-22786

03/11/2023, 12:28 AM
are you running a
pex_binary
target, or a
python_source
target? as of relatively recently, those have different implementations.
s

silly-queen-7197

03/11/2023, 12:28 AM
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

witty-crayon-22786

03/11/2023, 12:35 AM
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

bitter-ability-32190

03/11/2023, 12:51 AM
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

silly-queen-7197

03/11/2023, 12:57 AM
That's good to know. I had tried messing around with
execution_mode
but not
layout