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

breezy-apple-27122

02/28/2023, 2:05 PM
is there a way to call any files that are inside of the pex binary? like running a script that access files inside of the pex bundle
context is that
python_sources
cannot be added to
docker_image
target
c

curved-television-6568

02/28/2023, 2:28 PM
This post is packed with useful information on pex:es and docker https://blog.pantsbuild.org/optimizing-python-docker-deploys-using-pants/
r

refined-addition-53644

02/28/2023, 2:39 PM
You can use PEX_MODULE
Copy code
PEX_MODULE=<module> (python) custom.pex
Not sure if you need python in the middle or not.
magic 1
All this magic is mentioned here
b

breezy-apple-27122

02/28/2023, 3:45 PM
the blog post is very valid for python scripts. not for running a CLI like streamlit
assuming that the entrypoint is a python file, it works. but if the entrypoint is a module, then it gives a module not found. my limited python knowledge is not helping on this
r

refined-addition-53644

02/28/2023, 3:51 PM
what do you mean by file and module? In python world, module is a file.
e

enough-analyst-54434

02/28/2023, 4:15 PM
This sounds similar to the OpenTelemetry case. @breezy-apple-27122 it would probably be best to file an issue pared down as much as possible, with links to what you're talking about. I.E.: what is a "streamlit" and what command lines are you running, etc. For reference - @famous-xylophone-36532 and I worked through this same sort of jungle here: https://github.com/pantsbuild/pex/issues/2065 He was kind enough to whip up an example repo demonstrating the problem.
3 Views