Hi all, in CI I am trying to publish a docker imag...
# general
t
Hi all, in CI I am trying to publish a docker image with pants but do get the following error:
Copy code
Step 7/19 : RUN PEX_TOOLS=1 /usr/local/bin/python${PYTHON_MAJOR_VERSION} /airflow.pex venv --scope=deps --compile /bin/app
226
 ---> Running in 2b8af7465acb
227
/root/.pex/unzipped_pexes/e0301297fe4ddf169aa6719ab9d2a54623e7c0e4/.bootstrap/pex/dist_metadata.py:399: PEXWarning: Ignoring 2 `Requires` fields in /root/.pex/unzipped_pexes/e0301297fe4ddf169aa6719ab9d2a54623e7c0e4/.deps/Shapely-1.7.1-cp38-cp38-manylinux1_x86_64.whl metadata:
228
1.) Requires: Python (>=2.7)
229
2.) Requires: libgeos_c (>=3.3)
230

231
You may have issues using the 'Shapely' distribution as a result.
232
More information on this workaround can be found here:
233
  <https://github.com/pantsbuild/pex/issues/1201#issuecomment-791715585>
234

235
  pex_warnings.warn(
236
Encountered collisions building venv at /bin/app from /airflow.pex:
237
1. /bin/app/lib/python3.8/site-packages/tests/__init__.py was provided by:
238
	sha1:da39a3ee5e6b4b0d3255bfef95601890afd80709 -> /root/.pex/installed_wheels/d8d4faa3f1b898e56ac0581e2f00379c6d8f8f14ebc71592f5e5f83f3856be43/django_hosts-5.1-py3-none-any.whl/tests/__init__.py
239
	sha1:ec6017a2bb6aa49c4d51cacabb503f98670a56a6 -> /root/.pex/installed_wheels/eef914f5ea3507de209398874e1c404e5edf385ad22ca1029c769a75fc6ceeb6/draftjs_exporter-2.1.7-py3-none-any.whl/tests/__init__.py
240
2. /bin/app/lib/python3.8/site-packages/tests/test_defaults.py was provided by:
241
	sha1:2c2019f4e377693cdee64161a78f525a318cf174 -> /root/.pex/installed_wheels/d8d4faa3f1b898e56ac0581e2f00379c6d8f8f14ebc71592f5e5f83f3856be43/django_hosts-5.1-py3-none-any.whl/tests/test_defaults.py
242
	sha1:5b1d41d271ef3a72762f5008aa8c5fcdced64cb0 -> /root/.pex/installed_wheels/eef914f5ea3507de209398874e1c404e5edf385ad22ca1029c769a75fc6ceeb6/draftjs_exporter-2.1.7-py3-none-any.whl/tests/test_defaults.py
243

244
stderr:
245
The command '/bin/bash -o pipefail -o errexit -o nounset -o nolog -c PEX_TOOLS=1 /usr/local/bin/python${PYTHON_MAJOR_VERSION} /airflow.pex venv --scope=deps --compile /bin/app' returned a non-zero code: 1
246

247

248

249
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
250

251
Error: Process completed with exit code 1.
I am not sure what this actually means to be honest. Running
PEX_TOOLS=1 /usr/local/bin/python${PYTHON_MAJOR_VERSION} /airflow.pex venv --scope=deps --compile /bin/app
locally in my devcontainer also errors so seems not related to the Dockerfile. Can you help?
b
It’s annoying when packages have files outside their normal folders like this! Pex is correctly detecting that django_hosts and draftjs_export are both trying to write to
…/site-packages/tests/test_default.py
and
…/tests/__init__.py
in the venv, and so one has to override the other. In some cases, this will break packages… Given these are test files, it probably doesn’t matter in this case. If you install pex manually and look at the
--help
for that subcommand, I think there’s a flag about “collisions ok” or something (I don’t recall exactly). The proper fix is upstream: getting those packages to stop trying to install their tests into the venv, or at least; not doing it under the generic “tests” subfolder.
t
Looks good, thank you!