plain-carpet-73994
08/07/2021, 11:47 PM./pants run
the executable it runs fine. However, I'm trying to build a cross-platform .pex
with:
platforms = [
'linux-x86_64-cp-37-m',
'macosx-10.14-x86_64-cp-37-m'
]
and I get
stderr:
ERROR: Could not find a version that satisfies the requirement stream-chat
ERROR: No matching distribution found for stream-chat
pid 181794 -> /home/oliver/.pyenv/versions/3.7.10/bin/python3.7 /home/oliver/.cache/pants/named_caches/pex_root/pip.pex/cf4106b4c7898b462f7c172dde686a9747103f1a --disable-pip-version-check --no-python-version-warning --exists-action a --isolated -q --cache-dir /home/oliver/.cache/pants/named_caches/pex_root --log /tmp/process-execution11pC41/.tmp/tmpgo8mme15/pip.log download --dest /tmp/process-execution11pC41/.tmp/tmp3aui1xab/macosx_10_14_x86_64-cp-37-cp37m --platform macosx_10_14_x86_64 --implementation cp --python-version 37 --abi cp37m --only-binary :all: --constraint constraints.txt firebase-admin google-cloud-firestore pydantic stream-chat typing_extensions --index-url <https://pypi.org/simple/> --find-links <https://us-central1-python.pkg.dev/infrastructure-314723/python-deps/> --retries 5 --timeout 15 exited with 1 and STDERR:
None
why would it have trouble getting stream-chat
when it's OS independent? Note that if I remove the macosx-10.14...
line from platforms
the ./pants package
succeeds.happy-kitchen-89482
08/08/2021, 5:05 AMhappy-kitchen-89482
08/08/2021, 5:05 AMplain-carpet-73994
08/08/2021, 11:38 PMhappy-kitchen-89482
08/09/2021, 2:01 AMplain-carpet-73994
08/09/2021, 2:58 AMplain-carpet-73994
08/09/2021, 2:59 AMhundreds-father-404
08/09/2021, 3:04 AMhappy-kitchen-89482
08/09/2021, 3:44 AMhappy-kitchen-89482
08/09/2021, 3:47 AMconstraints.txt
?happy-kitchen-89482
08/09/2021, 3:48 AM--constraints
flag, it seems to workworried-salesclerk-37834
08/09/2021, 1:31 PMhappy-kitchen-89482
08/09/2021, 2:37 PMhappy-kitchen-89482
08/09/2021, 2:44 PMhappy-kitchen-89482
08/09/2021, 2:48 PMpex --platform linux-x86_64-cp-37-m --platform macosx-10.14-x86_64-cp-37-m -o mypex.pex firebase-admin google-cloud-firestore pydantic stream-chat typing_extensions
workshappy-kitchen-89482
08/09/2021, 2:50 PMhappy-kitchen-89482
08/09/2021, 2:51 PMwitty-crayon-22786
08/09/2021, 3:57 PMenough-analyst-54434
08/09/2021, 5:17 PM--only-binary :all:
. That's required when passing the 4 platform bits.plain-carpet-73994
08/09/2021, 5:23 PM-ldebug
or have you determined that the issue is the --only-binary
flag? If it's that flag what's the workaround for libs like this that don't provide a wheel? And if it is that flag why was @happy-kitchen-89482 able to run the command without the constraint.txt
but with all the other flags and have it succeed?plain-carpet-73994
08/09/2021, 5:25 PMconstraints.txt
is quite large as there's lots of other binaries and libraries in our repo with additional dependencies. The stuff I think is relevant is:
stream-chat==3.11.0
firebase-admin==5.0.1
google-cloud-firestore==2.2.0
pydantic==1.8.2
typing-extensions==3.10.0.0
enough-analyst-54434
08/09/2021, 5:58 PM--resolve-local-platforms
that Pants doesn't use IIRC that can turn one of your platform arguments into a normal local resolve, but the other will still be foreign and so wheels cannot be built. To work around, you need to pre-build the needed wheels by hand for each required platform and serve them up from your own cheese shop or find links repo. You then add that repo via [python-repos]
indexes
or repos
list options: https://www.pantsbuild.org/docs/reference-python-reposenough-analyst-54434
08/09/2021, 6:03 PMenough-analyst-54434
08/09/2021, 6:16 PM--find-links
so that concept at least should make sense. You just need to add the pre-built wheels to that or else add a second find links repo with the pre-builts.happy-kitchen-89482
08/09/2021, 6:21 PM--only-binary :all:
happy-kitchen-89482
08/09/2021, 6:23 PMhappy-kitchen-89482
08/09/2021, 6:25 PMpex --platform linux-x86_64-cp-37-m --platform macosx-10.14-x86_64-cp-37-m -o mypex.pex firebase-admin google-cloud-firestore pydantic stream-chat typing_extensions
seems to do the right thinghappy-kitchen-89482
08/09/2021, 6:26 PMenough-analyst-54434
08/09/2021, 6:37 PMenough-analyst-54434
08/09/2021, 6:46 PMenough-analyst-54434
08/09/2021, 6:52 PMenough-analyst-54434
08/09/2021, 6:53 PMplain-carpet-73994
08/09/2021, 6:55 PMconstraints.txt
has stream-chat==3.11.0
.plain-carpet-73994
08/09/2021, 6:56 PMconstraints.txt
to pin a much, much older version.
Do I have that all right @enough-analyst-54434?enough-analyst-54434
08/09/2021, 6:56 PMenough-analyst-54434
08/09/2021, 6:57 PMenough-analyst-54434
08/09/2021, 6:57 PMplain-carpet-73994
08/09/2021, 7:04 PMhappy-kitchen-89482
08/09/2021, 8:28 PMhappy-kitchen-89482
08/09/2021, 8:28 PM