X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4005246f86d1459e1123ac399721054182e9fef6..4b4680a0a9e06ae926abfbf0d209725de44860a8:/action/main.py diff --git a/action/main.py b/action/main.py index fde3125..03228cb 100644 --- a/action/main.py +++ b/action/main.py @@ -2,7 +2,7 @@ import os import shlex import sys from pathlib import Path -from subprocess import run, PIPE, STDOUT +from subprocess import PIPE, STDOUT, run ACTION_PATH = Path(os.environ["GITHUB_ACTION_PATH"]) ENV_PATH = ACTION_PATH / ".black-env" @@ -14,9 +14,10 @@ VERSION = os.getenv("INPUT_VERSION", default="") run([sys.executable, "-m", "venv", str(ENV_PATH)], check=True) -req = "black[colorama,python2]" -if VERSION: - req += f"=={VERSION}" +version_specifier = VERSION +if VERSION and VERSION[0] in "0123456789": + version_specifier = f"=={VERSION}" +req = f"black[colorama]{version_specifier}" pip_proc = run( [str(ENV_BIN / "python"), "-m", "pip", "install", req], stdout=PIPE,