https://pantsbuild.org/ logo
#pex
Title
# pex
w

witty-crayon-22786

03/19/2020, 12:03 AM
following up on the above, now more specifically about this conflict
grepping out requirements via
grep Requires-Dist | grep tzlocal
results (after some minimization) in just:
Copy code
Requirements for .pants.d/requirements/requirements/CPython-3.6.4/0cfa43bd645c858724d885e1384d6c07919de10b/.deps/apache_airflow-1.10.0+twtr26-py2.py3-none-any.whl/apache_airflow-1.10.0+twtr26.dist-info/METADATA: 
Requires-Dist: tzlocal (>=1.4)
Requirements for .pants.d/requirements/requirements/CPython-3.6.4/0cfa43bd645c858724d885e1384d6c07919de10b/.deps/pendulum-1.4.4-cp36-cp36m-macosx_10_13_x86_64.whl/pendulum-1.4.4.dist-info/METADATA: 
Requires-Dist: tzlocal (>=1.5.0.0,<2.0.0.0)
i'm following up to see if i can get a pex-only repro, but... something is fishy
because the resulting resolve error is
Copy code
pendulum==1.4.4 requires tzlocal<2.0.0.0,>=1.5.0.0 but tzlocal 2.0.0 was resolved
... oh. hm. maybe i should have been grepping for pendulum then.
hm, no. i just don't know why tzlocal was resolved at
2.0.0
.
(oh my lord, airflow's deps are a mess.)
it takes a long time to run, but
Copy code
SLUGIFY_USES_TEXT_UNIDECODE=yes pex 'apache_airflow==1.10.0' 'pendulum==1.4.4'
with pex 2.1.6 reproduces the
tzlocal
conflict
which, afaict, seems to be erroneous if both requirements are considered "at once".
explicitly pinning to
tzlocal==1.5.1
resolves this, but it nonetheless feels like a bug.
can open a report if it doesn't seem like i'm missing something
e

enough-analyst-54434

03/19/2020, 12:55 AM
A bug in pip unfortunately, aka won't reasonably be able to fix. Pinning a fake dep or using constraints,txt support will be the only answer. Still verifying though...
w

witty-crayon-22786

03/19/2020, 12:57 AM
got it... thanks. pinning worked around this here... ie, adding a dep in a BUILD file on a tzlocal==1.5.1 dep
e

enough-analyst-54434

03/19/2020, 12:58 AM
OK, so you found something like this?:
Copy code
$ zipinfo -1 examine.pex | grep METADATA | while read md; do echo "Examining $md"; unzip -qc examine.pex $md | grep tzlocal | grep Requires; done | grep -B1 Requires
Examining .deps/apache_airflow-1.10.0-py2-none-any.whl/apache_airflow-1.10.0.dist-info/METADATA
Requires-Dist: tzlocal (>=1.4)
--
Examining .deps/pendulum-1.4.4-cp27-cp27mu-linux_x86_64.whl/pendulum-1.4.4.dist-info/METADATA
Requires-Dist: tzlocal (<2.0.0.0,>=1.5.0.0)
w

witty-crayon-22786

03/19/2020, 12:58 AM
yep!
exactly that.
e

enough-analyst-54434

03/19/2020, 12:59 AM
Yeah, fake dep pin or constraints. Pex pre 2.0 had same issue with its resolver for different cases solved in the same way.
The upshot is both resolvers are very naive. The benefit of pip is at least its standard. May move to poetry resolver at some point and then there will be options like the Toolchain resolver.
w

witty-crayon-22786

03/19/2020, 1:07 AM
do you know of a reference for this pip bug?
e

enough-analyst-54434

03/19/2020, 1:31 AM
The origin issue is this one, but its generic. Pip folks know their resolver is generically bad: https://github.com/pypa/pip/issues/988
w

witty-crayon-22786

03/19/2020, 1:59 AM
thank you!