lgeiger / black-action

A GitHub action that runs black code formatter for Python
MIT License
190 stars 35 forks source link

Crash on setup: "Failed building wheel for typed-ast" #12

Open tburrows13 opened 4 years ago

tburrows13 commented 4 years ago

Hello,

Starting last week, all of our black GitHub actions started failing during setup, for example: https://github.com/Zulko/moviepy/pull/1334/checks?check_run_id=1220896230

I wonder if the default Python version install in the docker file has changed - FROM python:3 - maybe it went to Python 3.9? (https://github.com/python/typed_ast/issues/146 might be relevant).

mflaxman commented 4 years ago

For others, I've submitted a PR to fix this here: https://github.com/lgeiger/black-action/pull/13

In the meantime, you can see my workaround here: https://github.com/cryptoadvance/specter-desktop/pull/497/files

tburrows13 commented 4 years ago

Alternatively I found that the actual Black repo psf/black has a GitHub action (even though it is not listed in the GitHub marketplace): https://github.com/Zulko/moviepy/pull/1337/files. It doesn't allow adding arguments to the black call though.

mflaxman commented 4 years ago

Ya, not having arguments wasn't an option for my use-case :(

Gowee commented 4 years ago

Let me try to make the problem clear:

black relies on typed-ast which does not have the .whl ready for Python 3.9, resulting in the need of gcc (and hence failures).

But the official black action by psf now appears to work well on Python 3.9 (see https://github.com/psf/black/issues/1747 and https://github.com/Zulko/moviepy/pull/1337/files given by @tburrows13 ). How could that be done now that its Dockerfile is almost identical to this project's? I am wondering where the magic happens?

tburrows13 commented 4 years ago

@mflaxman psf/black has just added support for custom arguments in https://github.com/psf/black/pull/1755

mflaxman commented 4 years ago

Thank you @tburrows13! I submitted a PR to this open-source project to use it: https://github.com/cryptoadvance/specter-desktop/pull/529