Navigation Menu

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 actions black run suddenly failing #3538

Closed
ThomasWaldmann opened this issue Feb 1, 2023 · 5 comments
Closed

github actions black run suddenly failing #3538

ThomasWaldmann opened this issue Feb 1, 2023 · 5 comments
Labels
T: bug Something isn't working

Comments

@ThomasWaldmann
Copy link

ThomasWaldmann commented Feb 1, 2023

Describe the bug

We suddenly have black fail on a PR that has no related changes.
After merging the PR, black is now also failing on master branch.

https://github.com/borgbackup/borg/actions/runs/4063411463/jobs/6995614199
https://github.com/borgbackup/borg/blob/master/.github/workflows/black.yaml

We pinned black to 22.6.0 there, log says:

Download action repository 'psf/black@22.6.0' (SHA:f6c139c5215ce04fd3e73a900f1372942d58eca0)

We also use that locally via our requirements.d/codestyle.txt.

If I run black 22.6.0 locally, it says everything is fine and it doesn't want to reformat anything.

Expected behavior

Should behave the same way locally as on github actions if using same black version.

Environment

  • Black's version: 22.6.0
  • OS and Python version: local: macOS, python 3.10.9. github action: ubuntu 20.04, python 3.8.10(?)

Additional context

It worked fine until about today (2023-02-01).

Here is a black run of yesterday:

https://github.com/borgbackup/borg/actions/runs/4059816119/jobs/6988280083

Master branch, single-line changeset, no complaints.

@ThomasWaldmann
Copy link
Author

I locally upgraded to black 23.1.0 (latest version) and the changes it wants look quite the same as what I see on github actions.

So I suspect that @22.6.0 did somehow not work and it installed / used the latest version there.

To actually see the version it really installed on github actions, it would be useful if black told its version before it shows the diff.

ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Feb 1, 2023
work around the current github actions issue by just using the latest version:

psf/black#3538
@ThomasWaldmann
Copy link
Author

A temporary workaround might be to just upgrade / pin to the current version (@23.1.0) and let it reformat the codebase using that.

@JelleZijlstra
Copy link
Collaborator

Quite confusingly, the GH Action's version is independent from the version of Black that is used to format the code. #3282 is tracking the fix for this issue.

See https://black.readthedocs.io/en/stable/integrations/github_actions.html for how to format the version of Black used by the action.

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2023
@ThomasWaldmann
Copy link
Author

ThomasWaldmann commented Feb 1, 2023

@JelleZijlstra the issue you linked is about Jupyter notebooks.

The docs link was helpful, thanks!

https://github.com/borgbackup/borg/pull/7316/files

@JelleZijlstra
Copy link
Collaborator

Sorry, I meant #3382.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants