Python project from scratch with poetry, black, ruff, pytest, pre-commit-hooks and GitHub Actions in 15 min tops

https://laszlo.substack.com/p/cq4ds-python-project-from-scratch

poetry: Sort out virtual environments for good, all your project definitions in pyproject.toml.

black: You can have any code style until it is black. Stop worrying about formatting your code.

ruff: New blazing fast linter, anything that black doesn’t care about will be fixed here

pytest: Testing, duh…

pre-commit-hooks: Automate all of the above and forget about them.

GitHub Actions: Run these on the remote as well, just to be sure.

See also: What’s the difference between setup.cfg, pyproject.toml, and setup.py? https://ericmjl.github.io/blog/2023/8/31/whats-the-difference-between-setupcfg-pyprojecttoml-and-setuppy/

Here’s the tl;dr: Of the three, use pyproject.toml!

More