Commit Graph

16 Commits

Author SHA1 Message Date
Tsvika Shapira
dd278cb316
update github-action to look for black version in "dependency-groups" (#4606)
"dependency-groups" is the mechanism for storing package requirements in `pyproject.toml`, recommended for formatting tools (see https://packaging.python.org/en/latest/specifications/dependency-groups/ )

this change allow the black action to look also in those locations when determining the version of black to install
2025-03-20 08:01:31 -07:00
S.S
2f88085da5
Github Action: Directly install from repo if export-subst is skipped (#4313) 2024-04-23 20:01:53 -07:00
Sebastian Rittau
3383f531bc
GitHub Action: Allow reading version from pyproject.toml (#4294)
Closes #4285

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-05 08:40:40 -04:00
Christian Proud
c36e468794
Remove ENV_PATH on Black action completion (#3759) 2023-08-08 11:12:05 -07:00
Matthieu Simon
c97b9c55b4
[github action] display black result in job summary (#3688)
* send output to $GITHUB_STEP_SUMMARY

* update CHANGES.md

* update CHANGES.md with PR number

* implement PR feedback

* fix pre-commit issues (prettier/trailing whitespace)
2023-05-15 14:35:39 -07:00
Jakub Kuczys
b542f589a5
Use GH action version when version argument not specified (#3543) 2023-03-27 18:40:27 -07:00
Antonio Ossa-Guerra
6b42c2b8c9
Add option to format Jupyter Notebooks in GitHub Action (#3282)
To run the formatter on Jupyter Notebooks, Black must be installed
with an extra dependency (`black[jupyter]`). This commit adds an
optional argument to install Black with this dependency when using the
official GitHub Action [1]. To enable the formatter on Jupyter
Notebooks, just add `jupyter: true` as an argument. Feature requested
at [2].

[1]: https://black.readthedocs.io/en/stable/integrations/github_actions.html
[2]: https://github.com/psf/black/issues/3280

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>
2022-09-26 17:45:34 -04:00
Jakub Kuczys
bfc013ab93
Support version specifiers in GH action (#3265)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-09-22 20:23:35 -07:00
Richard Si
44d5da00b5 Reformat codebase with isort 2022-07-27 17:19:28 -04:00
Richard Si
e401b6bb1e
Remove Python 2 support (#2740)
*blib2to3's support was left untouched because: 1) I don't want to touch
parsing machinery, and 2) it'll allow us to provide a more useful error
message if someone does try to format Python 2 code.
2022-01-10 04:16:30 -08:00
Stefan Foulis
4005246f86
Add version to github action (and rewrite the whole thing while at it) (#1940)
Commit history before merge:

* Add black_version to github action
* Merge upstream/main into this branch
* Add version support for the Black action pt.2

  Since we're moving to a composite based action, quite a few changes
  were made. 1) Support was added for all OSes (Windows was painful). 
  2) Isolation from the rest of the workflow had to be done manually
  with a virtual environment.

  Other noteworthy changes:

  - Rewrote basically all of the logic and put it in a Python script
    for easy testing (not doing it here tho cause I'm lazy and I can't
    think of a reasonable way of testing it).
  - Renamed `black_version` to `version` to better fit the existing
    input naming scheme.
  - Added support for log groups, this makes our action's output a
    bit more fancy (I may or may have not added some debug output too).

* Add more to and sorta rewrite the Action's docs

  Reflect compatability and gotchas.

* Add CHANGELOG entry
* Merge main into this branch
* Remove debug; address typos; clean up action.yml

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-05-31 21:45:50 -04:00
Richard Si
4b7b5ed5b8
Fix broken Action entrypoint (#2202) 2021-05-06 12:21:13 -07:00
Shota Ray Imaki
5316836393
Simplify GitHub Action entrypoint (#2119)
This commit simplifies entrypoint.sh for GitHub Actions by removing
duplication of args and black_args (cf. #1909).

The reason why #1909 uses the input id black_args is to avoid an overlap
with args, but this naming seems redundant. So let me suggest option
and src, which are consistent with CLI. Backward compatibility is
guaranteed; Users can still use black_args as well.

Commit history pre-merge:
* Simplify GitHub Action entrypoint (#1909)
* Fix prettier
* Emit a warning message when `black_args` is used

  This deprecation should be visible in GitHub Action's UI now.

  Co-authored-by: Shota Ray Imaki <shota.imaki.0801@gmail.com>
  Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-05-05 22:25:43 -04:00
Thomas Hagebols
3d06894707
Set gh action entrypoint interpreter to bash (#1919) 2021-01-11 08:23:11 -08:00
Rick Staa
ba3648d984
Release gh action (#1909)
* Gets gh-action ready for marketplace release

* Updates documentation and removes redundant gh-action input argument

* Fixes gh-action bug

This commit fixes a bug which caused not all input arguments were forwarder to the black formatter.

* Update README.md

Co-authored-by: Cooper Lees <me@cooperlees.com>

Co-authored-by: Cooper Lees <me@cooperlees.com>
2021-01-08 11:47:03 -08:00
Hadi Alqattan
4d6a84a829
Allow black's Github action params overriding. (#1755)
* Allow default params overriding.

* Update: docs and action.yaml.

* The second contirbution, add my name to authors.md

* Correct docs `with.args` example.

* Just to rerun the Travis jobs.

* chmod 755
2020-10-18 14:24:33 -07:00