bulky-evening-6293404/08/2020, 5:23 PM
python_binary( name='demo', dependencies=[ '3rdparty/python:tensorflow', ], platforms=[ 'current', ], source='main.py' )
platforms is macos, but I want to build a pex file also works on linux (ubuntu), I tried several possible values for platform but None of them work Any idea about setting a proper platform value here ?
hundreds-father-40404/08/2020, 5:31 PM
. If you upgrade to Pants 1.27.0.dev2, run
for more information on all the fields that you can use with a
./pants target-types2 --details='python_binary'
, including the
bulky-evening-6293404/08/2020, 7:15 PM
hundreds-father-40404/08/2020, 7:16 PM
), be sure you are using 1.27.0.dev2. Until then, the V2 implementation was ignoring the value
target, but that’s now fixed.
bulky-evening-6293404/08/2020, 7:19 PM
file in that new python repo example
happy-kitchen-8948204/08/2020, 7:21 PM
bulky-evening-6293404/08/2020, 7:22 PM
happy-kitchen-8948204/08/2020, 7:22 PM
need to be
, or just omitted?
hundreds-father-40404/08/2020, 7:24 PM
. So, now you need to be more strict
happy-kitchen-8948204/08/2020, 7:24 PM
bulky-evening-6293404/08/2020, 7:25 PM
, some use
, some use
, are they actually same if I just specify linux as platform ?
hundreds-father-40404/08/2020, 7:29 PM
because Linux distributions vary so much, e.g. the Linux distro on your Android phone might be very different than the server for Pants docs vs. an embedded system. So, Python devs came up with the idea of “manylinux1” in 2016 as a way to say “my wheel only depends on this constrained set of the kernel”. See https://www.python.org/dev/peps/pep-0513/ for the original PEP that introduced this. They’ve gone through a couple iterations. https://www.python.org/dev/peps/pep-0571/ added
to say that you depend on more modern symbols than
. Then, Python devs realized how hard it is to maintain so many different
tags, so they generalized the scheme in https://www.python.org/dev/peps/pep-0600/
bulky-evening-6293404/08/2020, 7:35 PM
not work for me, what’s your build file ?
ERROR: Could not find a version that satisfies the requirement termcolor>=1.1.0 (from tensorflow==2.1.0) (from versions: none) ERROR: No matching distribution found for termcolor>=1.1.0 (from tensorflow==2.1.0)
hundreds-father-40404/08/2020, 7:41 PM
(sdist / source distribution) into a Linux-compatible wheel Is it possible to build TensorFlow without that? I’m surprised that they’re depending on a library last updated in 2011.
bulky-evening-6293404/08/2020, 7:42 PM
hundreds-father-40404/08/2020, 7:42 PM
what if I have 2 dependencies, one has wheel prebuilt by manylinux2010 and another one by manylinux1, which platform I need to specify ?I believe if you specify
, then Pex/Pip will still build because
is future compatible with all new
tags. Conversely, if you said
, it would fail to build because
is not backwards compatible with
is possible (and how) to fetch 3rdparty dependencies (wheel) from my private PyPI server or cloud server or local ?Yes, for this, you’d want to set
options scope, like this in `pants.toml`:
I’m honestly not sure what goes in those, though. @happy-kitchen-89482 do you know the difference? FYI you can run
[python-repos] repos.add =  indexes.add = 
for some more information, although we need to improve the documentation here.
./pants help python-repos
bulky-evening-6293404/08/2020, 7:48 PM
hundreds-father-40404/08/2020, 7:50 PM
on PyPI but that there is one in your custom repository
target through the fields
) We haven’t yet hooked up the global options
./pants target-types --details=python_binary
to the V2 implementation, which is an oversight we’ll fix.
happy-kitchen-8948204/08/2020, 8:24 PM
doesn't work in v2? We will fix that ASAP if so. I had thought I was able to use it with gemfury...
hundreds-father-40404/08/2020, 10:56 PM
enough-analyst-5443404/10/2020, 4:45 PM
hundreds-father-40404/10/2020, 5:34 PM
. You’ll want to use
instead, per the explanation in https://github.com/pantsbuild/pex/issues/953.