wonderful-iron-54019
07/21/2020, 7:44 PMwonderful-iron-54019
07/21/2020, 7:44 PMwonderful-iron-54019
07/21/2020, 7:44 PMwonderful-iron-54019
07/21/2020, 7:45 PMpython_requirements
targetwonderful-iron-54019
07/21/2020, 7:45 PMwonderful-iron-54019
07/21/2020, 7:46 PMwonderful-iron-54019
07/21/2020, 7:46 PMhundreds-father-404
07/21/2020, 7:47 PMhundreds-father-404
07/21/2020, 7:48 PMwonderful-iron-54019
07/21/2020, 7:49 PMwonderful-iron-54019
07/21/2020, 7:50 PMhundreds-father-404
07/21/2020, 7:51 PMrequirements.txt
is the first step. But it doesn’t actually result in anything being used; it just creates a new target for you.
The next step is explicitly depending on it by adding 3rdparty/python:Werkzeug
to the dependencies
field of the impacted target. Where it’s unergonomic is that you may need to add this to multiple targetshundreds-father-404
07/21/2020, 7:51 PMapache-airflow
?wonderful-iron-54019
07/21/2020, 7:51 PMwonderful-iron-54019
07/21/2020, 7:52 PMwonderful-iron-54019
07/21/2020, 7:52 PMwonderful-iron-54019
07/21/2020, 7:53 PMhundreds-father-404
07/21/2020, 7:53 PMhundreds-father-404
07/21/2020, 7:53 PMthat would stand to reason that adding that to any target would workCorrect, if the above message doesn’t end up being an issue.
wonderful-iron-54019
07/21/2020, 7:53 PMwonderful-iron-54019
07/21/2020, 7:54 PMwonderful-iron-54019
07/21/2020, 7:54 PMwonderful-iron-54019
07/21/2020, 7:54 PMwonderful-iron-54019
07/21/2020, 7:54 PMwonderful-iron-54019
07/21/2020, 7:54 PMhundreds-father-404
07/21/2020, 7:56 PM1.0.1
to be resolved.
Y’all are using Pipenv, right? Pipenv isn’t complaining about a conflict?wonderful-iron-54019
07/21/2020, 7:56 PMwonderful-iron-54019
07/21/2020, 7:57 PMpipenv_requirements
concpet in pants)wonderful-iron-54019
07/21/2020, 7:57 PMwonderful-iron-54019
07/21/2020, 7:58 PMhundreds-father-404
07/21/2020, 7:59 PMdependees
, that is find who is using werkzeug
in your project.
I suspect that you have a req that says something loose like Werkzeug>0.8
. Then, Pex/Pip will use the latest that’s valid, e.g. 1.0.1. Later, when encountering apache-airflow, Pip complains that it already has resolved 1.0.1 so can’t meet the new constraintwonderful-iron-54019
07/21/2020, 7:59 PMhundreds-father-404
07/21/2020, 7:59 PMwonderful-iron-54019
07/21/2020, 7:59 PMextras
wonderful-iron-54019
07/21/2020, 7:59 PMwonderful-iron-54019
07/21/2020, 8:00 PMhundreds-father-404
07/21/2020, 8:01 PMhundreds-father-404
07/21/2020, 8:01 PMpipenv graph
isn’t showing anything helpful?wonderful-iron-54019
07/21/2020, 8:02 PMhundreds-father-404
07/21/2020, 8:02 PMWerkzeug<0.1
. See what errors when you do that, other than apache-airflow
.wonderful-iron-54019
07/21/2020, 8:03 PMmoto
has a Werkzeug=*
dependencyhundreds-father-404
07/21/2020, 8:04 PMwonderful-iron-54019
07/21/2020, 8:04 PMwonderful-iron-54019
07/21/2020, 8:05 PM<1
and *
are compatible and applies the most restrictivewonderful-iron-54019
07/21/2020, 8:05 PMwonderful-iron-54019
07/21/2020, 8:05 PMwitty-crayon-22786
07/21/2020, 8:07 PMRequires
lines in the metadata are enough to render the conflicthundreds-father-404
07/21/2020, 8:07 PMapache-airflow
version that works with >1.0
3) Upgrade to 2.0 and use a constraints file to force the version you want to always be used.wonderful-iron-54019
07/21/2020, 8:07 PMwonderful-iron-54019
07/21/2020, 8:07 PMhundreds-father-404
07/21/2020, 8:07 PMwonderful-iron-54019
07/21/2020, 8:08 PMwonderful-iron-54019
07/21/2020, 8:08 PMhundreds-father-404
07/21/2020, 8:08 PMhundreds-father-404
07/21/2020, 8:09 PMwonderful-iron-54019
07/21/2020, 8:11 PMwonderful-iron-54019
07/21/2020, 8:11 PMwonderful-iron-54019
07/21/2020, 8:11 PMwonderful-iron-54019
07/21/2020, 8:11 PMhundreds-father-404
07/21/2020, 8:11 PMpolite-garden-50641
07/21/2020, 8:13 PMwonderful-iron-54019
07/21/2020, 8:14 PMhundreds-father-404
07/21/2020, 8:14 PM./pants dependencies --transitive --type=3rdparty path/to:target-with-airflow
, does Moto show up?polite-garden-50641
07/21/2020, 8:15 PMhundreds-father-404
07/21/2020, 8:15 PMdependencies2
would be faster)hundreds-father-404
07/21/2020, 8:15 PMthis is no longer needed since we now use dependency inferencing and pants seems to be able to do the right thing.True if using Pants 2.0. They’re still on 1.29 and using v1 for this part of the pipeline. But good point for the near future 🙂
wonderful-iron-54019
07/21/2020, 8:16 PMpolite-garden-50641
07/21/2020, 8:16 PMhundreds-father-404
07/21/2020, 8:16 PM./pants binary ::
?wonderful-iron-54019
07/21/2020, 8:16 PM./pants setup-py ::
we're all wheels babypolite-garden-50641
07/21/2020, 8:16 PMwonderful-iron-54019
07/21/2020, 8:16 PMwonderful-iron-54019
07/21/2020, 8:17 PMhundreds-father-404
07/21/2020, 8:18 PM./pants setup-py ::
include a target that includes both the airflow code and the moto code? You can run ./pants list --provides ::
to see what has setup_py
definedwonderful-iron-54019
07/21/2020, 8:19 PMwonderful-iron-54019
07/21/2020, 8:19 PMwonderful-iron-54019
07/21/2020, 8:19 PMwonderful-iron-54019
07/21/2020, 8:19 PMwonderful-iron-54019
07/21/2020, 8:19 PMhundreds-father-404
07/21/2020, 8:20 PMsetup_py
that includes both moto
and apache-airflow
in its transitive dependencies; not necessarily it’s direct dependencieswonderful-iron-54019
07/21/2020, 8:20 PMwonderful-iron-54019
07/21/2020, 8:21 PMhundreds-father-404
07/21/2020, 8:22 PMsetup-py
? You can run ./pants dependees --transitive path/to:target
for thatwonderful-iron-54019
07/21/2020, 8:22 PMwonderful-iron-54019
07/21/2020, 8:23 PMapache-airflow
that runs setup-pywonderful-iron-54019
07/21/2020, 8:23 PMwonderful-iron-54019
07/21/2020, 8:23 PM::
selector would that be a problem?hundreds-father-404
07/21/2020, 8:24 PMthere is one target with apache-airflow that runs setup-pyFor this target in particular,
./pants dependencies --transitive --type=thirdparty
does not include moto
, right?wonderful-iron-54019
07/21/2020, 8:24 PMhundreds-father-404
07/21/2020, 8:26 PMsetup-py
is..which I don’t know anything about. @happy-kitchen-89482 with v1 setup-py, are each of the distinct targets treated as completely separate and hermetic?
(fwit, v2 definitely would do the right thing, but I know that’s not a great answer rn)hundreds-father-404
07/21/2020, 8:27 PMtags
field, like tags=["dont_build"]
. Then, instead of ./pants setup-py ::
, use ./pants --tags='-dont_build' setup-py ::
, followed by ./pants setup-py path/to:airflow
as a separate commandwonderful-iron-54019
07/21/2020, 8:29 PMwonderful-iron-54019
07/21/2020, 8:29 PMhappy-kitchen-89482
07/21/2020, 8:31 PMhappy-kitchen-89482
07/21/2020, 8:32 PMhappy-kitchen-89482
07/21/2020, 8:33 PM::
)? I have a feeling that in v1 ::
might be causing one big resolve with conflicts.wonderful-iron-54019
07/21/2020, 8:33 PMhappy-kitchen-89482
07/21/2020, 8:33 PMaloof-angle-91616
07/21/2020, 8:33 PMwonderful-iron-54019
07/21/2020, 8:34 PMhappy-kitchen-89482
07/21/2020, 11:15 PMresolve_requirements
task is running at all... Nothing in the setup-py task appears to need resolved requirements (and this makes sense - we're not actually running your code, just bundling it up with some metadata). Going to dig a little deeper.happy-kitchen-89482
07/21/2020, 11:41 PMhappy-kitchen-89482
07/21/2020, 11:41 PMhappy-kitchen-89482
07/21/2020, 11:41 PMhappy-kitchen-89482
07/21/2020, 11:41 PMhappy-kitchen-89482
07/21/2020, 11:41 PMhundreds-father-404
07/21/2020, 11:41 PMwonderful-iron-54019
07/22/2020, 11:57 AMBUILD
file. Touching our requirements.txt results in a 20min build and didn't want to potentially have to. do that multiple times EODwonderful-iron-54019
07/22/2020, 11:58 AM