https://pantsbuild.org/ logo
n

nice-france-74763

07/03/2021, 9:20 AM
Hey everyone, I'd like to use semantic version constraints in my projects based on my pyproject files. Is there any experiments to make this work? If not, is it something I can write a pants plugin to do or would it require some re-architecture of internals to make pants work with something like poetry?
h

hundreds-father-404

07/03/2021, 9:24 AM
Hi Brian, do you mean you are using Poetry currently and would like to have Pants support it? If so, this very recently landed!
n

nice-france-74763

07/03/2021, 9:24 AM
Yes! that's something I'd like
Here's some details about my use-case: In my monorepo I maintain different versions of many packages:
Copy code
python_architecture_linter (v1.0.0)
python_architecture_linter_cli (v0.2.0)
modular_provider_architecture_definition (v2.1.0)
python_architecture_linter_grimp_extension(v0.1.0)
And in-between there would be complex inter-dependencies, for example, the CLI might be able to use linter v0.9.0 and v1.0.0 In addition to that, other third-party dependencies. It might be that the .
..._definition
package needs third-party `astroid`'s latest features but the
python_architecture_linter
alone has no dependency on the "latest" feature so it can have a constraint against an older version.
It's still in early development but here is where I am so far in my project: https://github.com/Incognito/python-architecture-linter/
I was having a hard time finding the poetry extension but now I see it. Google lead me to the 2.0 docs instead of the latest ones. This looks like a great start, thanks for the hint 👍
h

hundreds-father-404

07/03/2021, 10:01 AM
Hm, you'll want to use 2.6, not 2.0: https://www.pantsbuild.org/v2.6/docs/python-third-party-dependencies#poetry-integration But note that there was a bug we hotfixed and haven't yet released. You can consume the hotfix by setting the env var PANTS_SHA=0182de9814c7694eed2b9407e3577684db26ea2e
n

nice-france-74763

07/03/2021, 10:04 AM
Awesome thank you 🙂 This will be my weekend hacking project for tomorrow.
3 Views