https://pantsbuild.org/ logo
#general
Title
# general
j

jolly-midnight-72759

12/01/2020, 5:24 PM
Is there a way to tell pants to not print warnings like
[WARN] Ignoring resolve_all_constraints...
? We want to put the minimal number of items in our constraints file as possible but we don't want to innundate people with these warnings.
h

hundreds-father-404

12/01/2020, 5:27 PM
Does
[GLOBAL].pants_ignore_warnings
work? I’m honestly not certain - we’ve only used it for deprecations. If it doesn’t work, we should fix that
We want to put the minimal number of items in our constraints file as possible
Warning that this means we can’t apply a huge performance optimization to use a single resolve for your tests and
typecheck
. You’ll end up needing to resolve requirements a lot more than normal, which is often the most expensive step
j

jolly-midnight-72759

12/01/2020, 5:30 PM
ugh
we need speed
h

helpful-lunch-92084

12/01/2020, 5:30 PM
if we do do a full constraints.txt, i know the recommended tip is to create a venv and do a pip install 3rdparty/python/requirements.txt, we happen to have more than a few custom python_requirement_libaries defined outside of requirements.txt due to various reasons (one such reason being package maintainers don’t specify proper dependencies and we have to kludge them with a python_requirement_library — pydata packages i’m looking at you…) so given that, does pants have a native way for listing out pip compatible package versions for all python_requirement_library targets?
h

hundreds-father-404

12/01/2020, 5:34 PM
It does, this script will include all
python_requirement_library
targets too https://www.pantsbuild.org/v2.2/docs/python-third-party-dependencies#tip-set-up-a-virtual-environment-optional There is a possible issue if you have incompatible requirements - those would need to be manually resolved, unfortunately, e.g. deleting the version you don’t want. It’s possible to, say, use the global resolve for 90% of your code, and still have some other places that diverge from it. When it diverges, you’ll get this warning and you’ll do the proper resolve, rather than the global resolve One of the biggest feature requests for Q4 is to support multiple constraints files
h

helpful-lunch-92084

12/01/2020, 5:34 PM
i know for instance in pants v1 i could do:
Copy code
./pants dependencies 3rdparty/python:mock
3rdparty/python:mock
mock==2.0.0
3rdparty/python:requirements.txt
and while the output is a little gnarly we could grep out the pip compatible package. But that doesn’t seem to work in v2
h

hundreds-father-404

12/01/2020, 5:35 PM
This script uses
./pants dependencies --type=3rdparty
to do the same thing. Which is a total misnomer. It really should be
./pants dependencies --3rdparty-type=requirement_string
or something like that
h

helpful-lunch-92084

12/01/2020, 5:35 PM
got it
thanks!
❤️ 1
3 Views