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

abundant-analyst-12845

01/10/2023, 11:55 AM
hi just a quick question. If I wanted to introduce pants for a poetry project that has has an existing
poetry.lock
file. should the
python.resolves
block point to the existing lock file like
common = poetry.lock
or more like
common = "3rdparty/python/common.lock"
am hoping to use this global poetry file to manage many "sub-projects" which will host lambda
r

refined-addition-53644

01/10/2023, 12:17 PM
Pants doesn’t use poetry lockfile. So you’ll have to generate one and hence point to some different path like the
common
you have mentioned above
a

abundant-analyst-12845

01/10/2023, 12:18 PM
Ok. Thanks just wanted to ensure am doing it right
👍 1
h

happy-kitchen-89482

01/10/2023, 12:38 PM
Letting Pants generate the lockfiles for you is preferable, but you can actually use poetry lockfiles: https://www.pantsbuild.org/docs/python-third-party-dependencies#manually-generating-lockfiles (with
poetry export
to turn them into requirements.txt-style files)
a

abundant-analyst-12845

01/10/2023, 12:40 PM
thanks. that might be more involved if the team would have to do it each time they add new dependency with
poetry add
so will try and use the pants generated lock file for one
a follow on question when using poetry one can more or less run poetry run against any of the installed packages . is that supported for pants as well, for example
poetry run tox -c folder/tox.ini -e mypy
is there an a equivalent one for pants