Hi, I'm facing a problem with scripts such as `uvi...
# general
a
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
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
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 🙂