Can pants (in future) do third party dependency ma...
# general
r
Can pants (in future) do third party dependency management like poetry does with
add
,
remove
or
update
? I suppose this won’t generalize across multiple languages.
h
We're definitely open to it! But I agree it needs a little design work. https://github.com/pantsbuild/pants/issues/12880 https://github.com/pantsbuild/pants/issues/15275
c
Couldn’t you use a poetry lock file, and then use the poetry tooling for add/remove/update?
h
Sort of - Pants can't understand Poetry native lockfiles. You could use
poetry export
, but it has some limitations like not always working correctly Also, we are likely soon going to switch to only accepting Pex lockfiles because they allow much better performance — we know how to install the specific subset of the lockfile needed for a particular task. Whereas non-Pex lockfiles require us to first install the whole lockfile, and then extract the subset of what's used
👍 2
we are likely soon going to switch to only accepting Pex lockfiles
This isn't 100% decided. We still allow you to use non-Pex lockfiles in requirements.txt-style, which was an important escape hatch as we rolled out Pex lockfiles. The Python ecosystem is huge, so we expected lots of edge cases we didn't know about We've now had Pex lockfiles for 3 months, and they're working pretty well from what we can tell. But we may want to keep the escape hatch. Unclear
p
Yes. Some tooling around managing deps would be immensely helpful. But, pants has more complexity to deal with than poetry. Poetry expects dependencies defined in one
pyproject.toml
and one poetry lock file and only one distribution/wheel will result. Pants has multiple resolves, multiple distributions, dependencies can be defined in requirements files, BUILD files, pipenv metadata, or poetry metadata (and eventually PEP 621 dependencies in
pyproject.toml
). So, the semantics are a lot more complicated for pants.
2