GitHub Action: Allow reading version from pyproject.toml#4294
Conversation
JelleZijlstra
left a comment
There was a problem hiding this comment.
Can we look for required-version in the tool.black table first? https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#required-version
That seems better than attempting to parse the dependency metadata.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
for more information, see https://pre-commit.ci
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks! Could you also add a changelog entry?
How to best do this? This doesn't really fit the existing structure of the |
It can go in the "Integrations" section (https://github.com/psf/black/blob/main/CHANGES.md#integrations). The Actions version is a little disconnected, but for most people the change should still become useful when we make our next release. |
Description
This adds an
use_pyprojectinput to the GitHub Action that – when set totrue– will read the black version from pyproject.toml file. Either from theproject.dependenciesarray or one of the arrays from theproject.optional-dependenciestable.Closes: #4285
Checklist - did you ...
CHANGES.mdif necessary?Trial runs at: https://github.com/srittau/python-asserts/actions/runs/8490172420, using this branch of one of my projects: https://github.com/srittau/python-asserts/tree/black-test