quaint-gold-40000
07/22/2021, 9:31 AMpoetry install
for all packages that specify package A as a path dependency so that their poetry.lock is updated.
I learned about Pants in a comment on an issue about monorepos on the Poetry issue tracker. I was hoping Pants would be able to solve the problem above. Does it? It's not clear to me what "Poetry support" in Pants encompasses. From, early experiments with Pants 2.6 it doesn't seem that Pants considers the Poetry lock files. I'm hoping someone can shed some light on this here. Thanks! 🙏powerful-boots-1234
07/22/2021, 9:33 AMpowerful-boots-1234
07/22/2021, 9:35 AMpowerful-boots-1234
07/22/2021, 9:37 AMAn issue I'm running into is that when a new dependency is added to package A, it is necessary to runÂThis is correct. not that you can do for all packages that specify package A as a path dependency so that their poetry.lock is updated.poetry install
poetry install library-name==version
and it only touches that library and it's transient dependencies. It's annoying but I'm not sure whether poetry or pants considers this a bug.powerful-boots-1234
07/22/2021, 9:39 AMI was hoping Pants would be able to solve the problem above. Does it? It's not clear to me what "Poetry support" in Pants encompasses. From, early experiments with Pants 2.6 it doesn't seem that Pants considers the Poetry lock files. I'm hoping someone can shed some light on this here. Thanks!You can test some stuff out here: https://github.com/ehiggs/pants-poetry-test-repos As 2.6.0 is still in rc stage there are plenty of workflows that need maturing and this only happens when people push on it.
quaint-gold-40000
07/22/2021, 9:40 AMpoetry install
needs to run for the top-level package when a pyproject.toml for a dependency changes.quaint-gold-40000
07/22/2021, 9:41 AMThis is correct. not that you can doÂYou can do and it only touches that library and it's transient dependencies. It's annoying but I'm not sure whether poetry or pants considers this a bug.poetry install library-name==version
poetry update <depencency>
though to limit changes to the venv and lock file.powerful-boots-1234
07/22/2021, 9:42 AMquaint-gold-40000
07/22/2021, 9:43 AMYou can test some stuff out here:Â https://github.com/ehiggs/pants-poetry-test-reposI did stumble upon that repo (thanks!). Does that setup somehow allow detecting changes to dependencies and updating the top-level package? If so, how?
quaint-gold-40000
07/22/2021, 9:47 AMpowerful-boots-1234
07/22/2021, 9:48 AMquaint-gold-40000
07/22/2021, 12:25 PMpowerful-boots-1234
07/22/2021, 2:26 PMfresh-cat-90827
07/22/2021, 2:57 PMWould that then handle creating individual distribution packages?Sorry, what do you mean by a “distribution package”?
witty-crayon-22786
07/22/2021, 3:57 PMpyproject.toml
files are consumed and used as the input to resolves. there are docs about it, but only on the 2.6 version of the docsite (not stable yet!): https://www.pantsbuild.org/v2.6/docs/python-third-party-dependencies#poetry-integrationproud-dentist-22844
07/22/2021, 3:58 PMpyproject.toml
, but it cannot read the poetry lock file at this point.
There is no tooling to help with a parent pyproject.toml
and children pyproject.toml
files. You might need to write a poetry plugin to handle propogating dependency updates through layered pyproject.toml
files in a monorepo like that.
Or, you could have one super pyproject.toml
file and lock file where you manage the superset of dependencies for all your libs. Then, you can use pants to see which dependencies are used by which packages. You could use pants to generate requirements.txt in each of those packages, and you can use pants to build a python distribution (wheel) which includes generating a setup.py file with all the relevant requirements embedded in it.witty-crayon-22786
07/22/2021, 3:59 PMpyproject.toml
files, if they each declare the same dependencies, you’ll end up needing to explicitly choose the version you want in your BUILD fileswitty-crayon-22786
07/22/2021, 3:59 PMwitty-crayon-22786
07/22/2021, 4:39 PMpyproject.toml
or other requirements.witty-crayon-22786
07/22/2021, 4:47 PMwitty-crayon-22786
07/22/2021, 4:48 PMnice-france-74763
07/22/2021, 6:19 PMwitty-crayon-22786
07/22/2021, 6:22 PM./pants lint typecheck test ::
, and the linters and tests would run concurrently… and run the same way in CI as locally.witty-crayon-22786
07/22/2021, 6:23 PMnice-france-74763
07/22/2021, 6:32 PMquaint-gold-40000
07/26/2021, 10:02 AMquaint-gold-40000
07/26/2021, 10:02 AMpoetry.lock
files are ignored by Pants.witty-crayon-22786
07/26/2021, 3:56 PM