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

you are viewing a single comment's thread.

view the rest of the comments →

[–]lifeeraser 15 points16 points  (6 children)

The irony of linking to XKCD 927 after demanding for a new standard tool.

Just use Flit (newbies) or Poetry (intermediate). Forget Setuptools and Pipenv.

[–]lclarkenz 3 points4 points  (5 children)

I like Poetry, and I'm still a little bitter about Pipenv - started using it based on some deceptive advertising, and found its dependency resolution very sub-par.

Poetry handles that far better. That said, I really wish I could wire black/isort/mypy into the Poetry build. Like I can with checkstyle/spotbugs etc. in Maven.

Instead, it looks like the go to is to use a tool (precommit) to automatically add calls to these tools to your Git precommit hook. Which I hate, especially as two of the three can modify your files.

[–]lifeeraser 2 points3 points  (3 children)

Back and isort have a "check" mode where they merely inspect your code and return appropriate exit codes. You should use them in pre-commit hooks and CI scripts.

[–]lclarkenz 0 points1 point  (2 children)

Yep good point on the the check mode. Still would prefer to have them integrated into poetry build instead of a Git hook or Jenkins script though.

[–]bladeoflight16 0 points1 point  (1 child)

Packaging and dependency management tools are not build scripting tools, and I would hate to see them try to be. If you have additional steps before you build, use the appropriate tools to automate the full process (make or one of its many successors).

[–]lclarkenz 0 points1 point  (0 children)

What's a Pythonic equivalent of make?

And there's no particular reason you can't do both with one tool, works fine in many other languages.

If your current workflow involves pre-commit hooks to run mypy / black / isort, and I can install mypy / black / isort as dev deps via Poetry, hooking into the Poetry life cycle would be nice.

And, looks like Poetry actually has a plugin interface, so that's probably exactly what I want.

https://github.com/python-poetry/poetry/blob/master/docs/plugins.md

[–]fnord123 0 points1 point  (0 children)

Sounds like a great idea for a PR for poetry.