More of a PEX question than a pants question but t...
# general
e
More of a PEX question than a pants question but thought it was worth a shot to ask here since we got the original recipe from Pants. We're using the Simple Multi-Stage Build recipe from the pantsbuild blog to run our pants-packaged PEXes in Docker. For the most part this has been working great. However, when doing this with a pex that transitively includes dbt-core, we see the following error:
Copy code
$ pex --include-tools "dbt-core==1.9.0b4" "dbt-adapters==1.9.0" "dbt-common==1.12.0"  -o dbt.pex
$ PEX_TOOLS=1 python dbt.pex venv --compile dbt_app/
Encountered collision populating /workspace/dbt_app from PEX at /workspace/dbt.pex:
1. /workspace/dbt_app/lib/python3.11/site-packages/dbt/__init__.py was provided by:
        sha1:94e22461fd95af9540b21a7b27a0475c7753320d -> /home/vscode/.cache/pex/installed_wheels/2/824fff0951402dc641bc271eacc7689c7391ae53044f8a32fffe2a60c99e85c9/dbt_adapters-1.9.0-py3-none-any.whl/dbt/__init__.py
        sha1:6598303830eb0ec5e957e02b78e86538843e1e97 -> /home/vscode/.cache/pex/installed_wheels/2/82505e139c5cf97745e86894b1b2817c13242259544116043678e35fc4f979a6/dbt_core-1.9.0b4-py3-none-any.whl/dbt/__init__.py
As the error describes, both dbt-core and dbt-adapters (which dbt-core depends on) provide an
__init__.py
which causes problems when unpacking the pex into a venv. Are there any known workarounds to continue using this recipe with such a package? Or should we just run the pex normally without the multi-stage build?