https://pantsbuild.org/ logo
#general
Title
# general
a

adamant-magazine-16751

04/06/2023, 3:16 PM
Hi, I'm facing a problem with scripts such as
uvicorn
when using
./pants export
I'd like to be able to sometimes run them without actually invoking pants. The reason is we've got some code in the repo that we do not package and only run during development or as pocs, and it is often easier and faster to just run it this way. The problem I'm facing is that the scripts ignore
PYTHONPATH
variable so I'm unable to import my first-party code. I compared the scripts exported using pants and the ones created with
pip install
and the only difference is in the shebang - the pants ones include
-sE
flags. This explains why they ignore
PYTHONPATH
. I assume this is by design. What's the rationale behind it? Is there a way to get rid of the
-E
flag?
s

sparse-lifeguard-95737

04/06/2023, 3:22 PM
You’re running into https://github.com/pantsbuild/pants/issues/17764. Pex has a flag to enable the desired functionality, but it hasn’t been plumbed through the Pants layer yet
a

adamant-magazine-16751

04/06/2023, 3:37 PM
Okay, nice to know there is an open issue for that. Should have done a quick search for that myself, my bad. Thanks for sharing 🙂
2 Views