cool-easter-32542
06/25/2024, 8:09 PMsrc/python/block. Within this directory are then to be projects that should all be importable via a block namespace. As an example, I have a Python project at src/python/block/hello_world. Within src/python/block/hello_world/BUILD, I have the following:
# Probably irrelevant but just including this since
# showcasing a path to migration of existing projects
# is important
poetry_requirements(
name="poetry",
)
pex_binary(
name="bin",
entry_point="cli:cli"
)
The main gist is that when i unzip a pex produced from this project, I do not see the desired import path of Python modules which results in import paths being broken. The source code is not listed in the block directory when listing the context of a path. In this example above, rather than block/cli/__init__.py being in the pex, just cli/__init__.py is in the pex.
I believe this is quite simple given this was one of the support "styles" at my previous employer I'm just a little rusty and having difficulties resolving this via the documentation.
pantsbuild/pants