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

fierce-france-72742

01/28/2021, 10:03 AM
Since I set a "contraints.txt" file, I realised after calling
package
on a target, calling
run
on it for the first time leads to a long contraints resolution step. I quite don't understand why those constraints are resolved after the ".pex" file was created. Isn't that pex file fully self-contained and hermetic?
👀 1
h

hundreds-father-404

01/28/2021, 5:33 PM
Hey Etienne! If you use a constraints file,
run
and
package
don't use the same requirements resolves Both
run
and
test
will resolve your entire
constraints.txt
and use the whole thing, which means that you should not need to resolve more than once for your repo Meanwhile,
package
will resolve the true subset so that the final binary only has what is actually needed, e.g. to keep the bundle size smaller See
./pants help-advanced python-setup
and
resolve_all_constraints
-- This is the first ticket on the newly released public roadmap, to improve this situation https://github.com/pantsbuild/pants/issues/11105 Once that's finished, we'll get the best of both worlds. You'll only need to resolve
constraints.txt
once, but everything will be using the true proper subset of dependencies
f

fierce-france-72742

01/28/2021, 5:47 PM
Hey Eric, thank you for your answer, it makes more sense to me know! Cool that you planned to work on that already 🙂
❤️ 1
5 Views