From 8df26493c467204dc6f94a9055aced3d74e4f95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Mon, 12 Oct 2020 10:36:18 +0100 Subject: [PATCH] Adopt new Github env-var set method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/workflows/check.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 94d5a11a9..604ac8fc8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -70,9 +70,13 @@ jobs: shell: python - name: Pick environment to run run: | - import subprocess; import json - major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True)) - print('::set-env name=TOXENV::' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else ""))) + import platform; import os; import sys; import codecs + cpy = platform.python_implementation() == "CPython" + base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2]) + env = "TOXENV={}\n".format(base) + print("Picked:\n{}for{}".format(env, sys.version)) + with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler: + file_handler.write(env) shell: python - name: Setup test suite run: tox -vv --notest