bulky-evening-62934
04/08/2020, 5:23 PMpython_binary(
name='demo',
dependencies=[
'3rdparty/python:tensorflow',
],
platforms=[
'current',
],
source='main.py'
)
My current 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-404
04/08/2020, 5:31 PMlinux_x86_64-cp-36-36m.
If you upgrade to Pants 1.27.0.dev2, run ./pants target-types2 --details='python_binary' for more information on all the fields that you can use with a python_binary, including the platforms fieldbulky-evening-62934
04/08/2020, 7:15 PMlinux_x86_64-cp-37-37m , but it doesn’t work, from tensorflow pip page, https://pypi.org/project/tensorflow/#files, they are using platform name manylinux-2010 , does it make any difference ?hundreds-father-404
04/08/2020, 7:16 PMmanylinux2010_x86_64-cp-37-37m work?hundreds-father-404
04/08/2020, 7:17 PMpants.backend.python to backend_packages2), be sure you are using 1.27.0.dev2. Until then, the V2 implementation was ignoring the value platforms in a python_binary target, but that’s now fixed.bulky-evening-62934
04/08/2020, 7:19 PMpants.toml file in that new python repo examplebulky-evening-62934
04/08/2020, 7:20 PMmanylinux2010_x86_64-cp-37-37m doesn’t workbulky-evening-62934
04/08/2020, 7:21 PMhappy-kitchen-89482
04/08/2020, 7:21 PMbulky-evening-62934
04/08/2020, 7:22 PMhappy-kitchen-89482
04/08/2020, 7:22 PM37 need to be 36 or 38, or just omitted?happy-kitchen-89482
04/08/2020, 7:22 PMhappy-kitchen-89482
04/08/2020, 7:22 PMhappy-kitchen-89482
04/08/2020, 7:22 PMhappy-kitchen-89482
04/08/2020, 7:22 PM37 is righthappy-kitchen-89482
04/08/2020, 7:24 PMhundreds-father-404
04/08/2020, 7:24 PMabi3. So, now you need to be more stricthappy-kitchen-89482
04/08/2020, 7:24 PMbulky-evening-62934
04/08/2020, 7:25 PMlinux, some use manylinux1, some use manylinux2010 or manylinux2014 , are they actually same if I just specify linux as platform ?hundreds-father-404
04/08/2020, 7:29 PMlinux 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 manylinux2010 to say that you depend on more modern symbols than manylinux1.
Then, Python devs realized how hard it is to maintain so many different manylinux tags, so they generalized the scheme in https://www.python.org/dev/peps/pep-0600/hundreds-father-404
04/08/2020, 7:32 PMmanylinux2010_x86_64-cp-37-mhundreds-father-404
04/08/2020, 7:32 PMbulky-evening-62934
04/08/2020, 7:35 PMmanylinux2010_x86_64-cp-37-m not work for me, what’s your build file ?bulky-evening-62934
04/08/2020, 7:36 PMERROR: 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)bulky-evening-62934
04/08/2020, 7:37 PMtar.gzbulky-evening-62934
04/08/2020, 7:38 PMhundreds-father-404
04/08/2020, 7:41 PM.tar.gz (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-62934
04/08/2020, 7:42 PMhundreds-father-404
04/08/2020, 7:42 PMwhat 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
manylinux2010, then Pex/Pip will still build because manylinux1 is future compatible with all new manylinux tags.
Conversely, if you said manylinux1, it would fail to build because manylinux10 is not backwards compatible with manylinux1hundreds-father-404
04/08/2020, 7:47 PMis 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
repos and/or indexes in the python-repos options scope, like this in `pants.toml`:
[python-repos]
repos.add = []
indexes.add = []
I’m honestly not sure what goes in those, though. @happy-kitchen-89482 do you know the difference?
FYI you can run ./pants help python-repos for some more information, although we need to improve the documentation here.bulky-evening-62934
04/08/2020, 7:48 PMhundreds-father-404
04/08/2020, 7:50 PMtermcolor on PyPI but that there is one in your custom repositoryhundreds-father-404
04/08/2020, 7:53 PMpython_binary target through the fields repositories and indices (run ./pants target-types --details=python_binary)
We haven’t yet hooked up the global options --python-repo to the V2 implementation, which is an oversight we’ll fix.happy-kitchen-89482
04/08/2020, 8:24 PMhappy-kitchen-89482
04/08/2020, 8:26 PMpython_repos 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-404
04/08/2020, 10:56 PMenough-analyst-54434
04/10/2020, 4:45 PMhundreds-father-404
04/10/2020, 5:34 PMmanylinux2010. You’ll want to use linux instead, per the explanation in https://github.com/pantsbuild/pex/issues/953.