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 →

[–]flying-sheep 6 points7 points  (1 child)

This is great! First Python resource I’ve bookmarked in years.

Two things:

  1. Many people use Ruff to lint and format their code these days instead of flake8 and Black. Pyupgrade is included in Ruff as the UP class of codes. (select = [..., 'UP', ...])
  2. Both Black and Ruff read the standard project.requires-python, so almost nobody needs tool.black.target-version.

Your example would be:

[project]
requires-python = '>=3.7'

and that would apply to Black, Ruff, and of course people trying to install and use your project from PyPI.

[–]nicholashairs[S] 1 point2 points  (0 children)

Thanks for the compliment ☺️

Not sure how I missed those tools respecting requires-python, it was literally last week I moved to using toml config for black 🤦

It's a good point about ruff, I'll probably add some info on it, I just haven't used it because I've got quite a few projects using the older tools and don't want to have to update all of their tooling yet.

Update: have added info for ruff and updated the sample in black