Skip to content

Commit

Permalink
Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
aaossa committed Sep 22, 2022
1 parent 6ae8457 commit 7af4287
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
'--check --diff'"
required: false
default: "--check --diff"
jupyter:
description: "Install the required extra to run on Jupyter Notebooks."
required: false
default: false
src:
description: "Source to run Black. Default: '.'"
required: false
Expand Down Expand Up @@ -38,6 +42,7 @@ runs:
# TODO: Remove once https://github.com/actions/runner/issues/665 is fixed.
INPUT_OPTIONS: ${{ inputs.options }}
INPUT_SRC: ${{ inputs.src }}
INPUT_JUPYTER: ${{ inputs.jupyter }}
INPUT_BLACK_ARGS: ${{ inputs.black_args }}
INPUT_VERSION: ${{ inputs.version }}
pythonioencoding: utf-8
Expand Down
7 changes: 6 additions & 1 deletion action/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
OPTIONS = os.getenv("INPUT_OPTIONS", default="")
SRC = os.getenv("INPUT_SRC", default="")
BLACK_ARGS = os.getenv("INPUT_BLACK_ARGS", default="")
JUPYTER = os.getenv("INPUT_JUPYTER")
VERSION = os.getenv("INPUT_VERSION", default="")

run([sys.executable, "-m", "venv", str(ENV_PATH)], check=True)

req = "black[colorama]"

if JUPYTER:
req = "black[colorama,jupyter]"
else:
req = "black[colorama]"
if VERSION:
req += f"=={VERSION}"
pip_proc = run(
Expand Down

0 comments on commit 7af4287

Please sign in to comment.