agreeable-breakfast-71396
11/11/2023, 8:34 PMpex
that will run a python cli tool (dagster
) against my module. Specifically dagster api grpc --module-name "my.module"
, where my.module
is part of my repository.
python_sources(
name="mymod",
)
pex_binary(
name="mymod_usercode",
entry_point = './main.py:main',
)
I have an entrypoint function in main.py
import ...
def main():
subprocess.run(
args = [
"dagster",
"api",
"grpc",
"-h",
"0.0.0.0",
"-p",
"4000",
"--module-name",
"my.module.main",
]
)
I can build a pex that can resolve all of the third-party dependencies, but none of the first party dependencies can be resolved: No module named 'my' while importing module 'my.module.main'
. Dropping into an interpreter with PEX_INTERPRETER=1
lets me import the module just fine.
Any advice on how I can do this (or if I even should be trying to do this)?
Many thanks in advance!late-advantage-75311
11/11/2023, 10:00 PMlate-advantage-75311
11/11/2023, 10:00 PMagreeable-breakfast-71396
11/12/2023, 7:29 PM