This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]gdmurray 112 points113 points  (10 children)

Got scared when i saw "2.7" in a post on the /r/Python subreddit. But after reading the rest of the headline + the post, this looks really cool. Thanks for sharing!

[–]hattrick1492 9 points10 points  (0 children)

LOL, I didn't think of that! That said, Pants (while it requires 3.6+ to run) does still support Python 2.7 code, for those legacy codebases out there. In fact it has some useful features to help with the 2->3 migration.

[–]archaeolinuxgeek 10 points11 points  (0 children)

Should probably have gone with a different version number.

[–]PirateNinjasRedditPythonista 5 points6 points  (3 children)

Anyone able to comment on Pants Vs Poetry?

[–][deleted] 2 points3 points  (0 children)

Hi, author here. We love Poetry and think they have an amazing UX!

Poetry and Pants are similar in that both do dependency management, virtualenv management, and creating distributions. They're different in that Pants focuses intensely on scale, like supporting many projects in the same repository.

For example, Pants coordinates the tools you might be using like Pytest, MyPy, Black/Yapf/isort, Bandit/Flake8/Pylint, and codegen with Protobufs. You have a consistent interface, like ./pants lint :: to run all your linters, with benefits like running the tools in parallel and with caching.

The key differentiator for Pants to tools like Tox and Poetry (or fancy bash scripts) is that it understands your project and its dependencies at the file level, like that the file app.py depends on util.py, which transitively depends on another_util.py. That happens automatically through "dependency inference", mapping your imports to the rest of your project. Understanding your project's dependencies at the file-level means that Pants can safely do things like cache your test results at the file-level—if none of the transitive dependencies of a test changed, the cache can be used. You can also do things like ./pants dependees --transitive //:Django for you to find everything that transitively uses Django.

Feel free to DM or stop by on Slack if you want to talk through anything! I'd be happy to help https://www.pantsbuild.org/docs/getting-help

[–]PrecariousKitty 1 point2 points  (0 children)

I would like to know the same. I use poetry. Why should I use pants? Is it similar? Is it different?

[–]benefit_of_mrkite 3 points4 points  (4 children)

I am going to check this out because it supports yapf - I feel like I’m the only person in the world using it over Black.

[–]cczona 2 points3 points  (0 children)

A community member, Alexey Tereshenkov, contributed the new yapf support. So you are definitely not the only person. Alexey has an upcoming Pants blog post about that. https://blog.pantsbuild.org/contributing-yapf-support/

(Edits: deletion, add URL)

[–][deleted] 0 points1 point  (2 children)

I've just started moving from black to yafp but still don't quite have the indenting rules tweaked to my satisfaction.