refined-addition-53644
12/14/2021, 11:07 AMpex
targets won't update itself by taking into account the changes in the provided 3rd party dependencies.
Whenever I run ./pants run <pex_target>
, if it fails because of some missing 3rd party dependency, it keeps failing even after I add that 3rd party dependency to say requirements.txt
. Is this expected?refined-addition-53644
12/14/2021, 11:08 AMenough-analyst-54434
12/14/2021, 11:58 AMrequirements.txt
? What is the import statement in the sources of the pex_binary
that needs to import from that dependency? Do the two align? If not, you are probably missing a module mapping. If none of the pex_binary
sources actually import from the dependency (some form of dynamic loading is used), you will need to add an explicit dependency to the pex_binary
or one of the python_sources
targets it depends on. Both of these cases are described in more detail here: https://www.pantsbuild.org/docs/python-third-party-dependencies see "How dependencies are chosen".
If none of that addresses your issue, we probably need more detailed information.enough-analyst-54434
12/14/2021, 12:01 PMrefined-addition-53644
12/14/2021, 1:18 PMpex_binary
. It did complain that it can't find the imported module. I even added the target generated from requirements.txt
using python_requirements
as a dependency explicitly but that didn't fix it either.
What "fixed" it was when I switched git branch, which is weird. Now it works, but I can't say that this is repeatable.enough-analyst-54434
12/14/2021, 1:27 PMrefined-addition-53644
12/14/2021, 1:27 PMrequirements.txt
is in a "non-standard" location
BUT: if you place yourin a non-standard location (or give it another name via therequirements.txt
argument), you will need to configurepython_requirements(source=..)
to restart for edits to the non-standard filename: see #9946.pantsd
enough-analyst-54434
12/14/2021, 1:29 PMrefined-addition-53644
12/14/2021, 1:32 PMThis did, in fact, bite at least one person with a file at src/requirements.txt.https://github.com/pantsbuild/pants/pull/9946/files#r602436641
hundreds-father-404
12/14/2021, 3:21 PM