Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action: Option to parse version from pyproject.toml #4285

Closed
srittau opened this issue Mar 19, 2024 · 0 comments · Fixed by #4294
Closed

GitHub Action: Option to parse version from pyproject.toml #4285

srittau opened this issue Mar 19, 2024 · 0 comments · Fixed by #4294
Labels
T: enhancement New feature or request

Comments

@srittau
Copy link
Contributor

srittau commented Mar 19, 2024

Is your feature request related to a problem? Please describe.

When using black's GitHub action "psf/black", you need to specify the black version to use manually as an option to the action, in addition to specifying it in pyproject.toml. This can easily lead to inconsistencies between the files, especially when using dependabot to keep the version current.

Describe the solution you'd like

It would be useful if the action could read the version to use from pyproject.toml. This would probably need a new option like "pyproject: true" to enable this behavior.

Describe alternatives you've considered

An alternative is to read pyproject.toml in a previous step in a GitHub workflow for example using SebRollen/toml-action, and provide the read value using a variable, but just using a flag to this action would be much easier and less error prone.

@srittau srittau added the T: enhancement New feature or request label Mar 19, 2024
srittau added a commit to srittau/black that referenced this issue Mar 30, 2024
JelleZijlstra added a commit that referenced this issue Apr 5, 2024
Closes #4285

Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant