cool-easter-32542
11/21/2023, 11:48 PMrepo_name/projects/myservice/dev-main-wrapper.py
"""Simple wrapper function to run src/main.py in the right context"""
import os
from src.main import main
os.chdir("./components/MTConnectClient")
main()
`repo_name/projects/myservice/BUILD`:
python_requirements(
name="reqs",
source="requirements.txt",
)
pex_binary(
name="pex_binary",
entry_point="src/main.py",
dependencies=[":reqs"]
)
python_source(
name="runner",
source="dev-main-wrapper.py",
dependencies=[":reqs"]
)
This works well it seems, and packaging via PEX loads the file as expected too, and all the dependencies get loaded correctly.
pantsbuild/pants