polite-secretary-23285
02/16/2022, 8:58 AMcurved-television-6568
02/16/2022, 9:25 AM• is it currently possible to respect poetry.lock ?I’ll share what I have in a project where we use poetry and pyproject.toml for managing 3rdparty dependencies. Alas, it’s one global, not per project. I’ve a
Makefile
to document/manage a constraints.txt
file referenced from pants.toml
as:
# pants.toml
[python]
# Use poetry export to regenerate this lockfile.
requirement_constraints = "constraints.txt"
# Makefile
constraints.txt: poetry.lock
poetry export --without-hashes > $@
poetry.lock: pyproject.toml
poetry lock --no-update && touch $@
• is it currently possible to have a poetry.lock for each project in the repo?I’ll let the others fill in the blanks here wrgt multiple lockfiles and what the support for that looks like at the moment.
busy-vase-39202
02/16/2022, 7:59 PMbusy-vase-39202
02/16/2022, 8:08 PMhappy-kitchen-89482
02/16/2022, 10:09 PMhappy-kitchen-89482
02/16/2022, 10:09 PMpolite-secretary-23285
02/17/2022, 8:16 AMbusy-vase-39202
02/17/2022, 5:18 PMhappy-kitchen-89482
02/18/2022, 4:00 PMhundreds-father-404
02/18/2022, 4:50 PMis it currently possible to respect poetry.lock ?No, the closest you can get is using
poetry export
so that pex (and thus pip) can understand it. Indeed, what Andreas shared
is it currently possible to have a poetry.lock for each project in the repo?Yes, this is possible in Pants 2.10.0rc1. Docs are still a WIP, but this option is how you'd do it: https://www.pantsbuild.org/v2.10/docs/reference-python#section-resolves. You would need to
poetry export
each project, then set it up as a distinct resolve. You'd also need to update all targets for that project to set the field resolve=<name>
Note that you could use ./pants generate-lockfiles
to generate the lockfiles. In Pants 2.10, we use Poetry to generate the lockfile, we literally run poetry lock && poetry export
for you. (That will change in Pants 2.11)hundreds-father-404
02/18/2022, 4:51 PMresolves
feature