From 99cfd71e40e97ae51771ae66bd18612234bd8eff Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Thu, 22 Dec 2022 16:58:15 +0100 Subject: [PATCH] Remove use of deprecated ::set-output GitHub command (#466) * [ci] Remove use of deprecated ::set-output GitHub command. The ::set-output command has been deprecated in favor of redirecting the output to a file. [0] This patch adjusts get-version.py to the new output syntax and silences tox output to avoid writing excess information to the file. [0] https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ Closes #429 Signed-off-by: Michael Seifert * [ci] Invoke get-version script directly, instead of starting it in a tox environment. This requires pytest-asyncio being installed. Signed-off-by: Michael Seifert * [refactor] Removed obsolete "version-info" tox environment. Signed-off-by: Michael Seifert Signed-off-by: Michael Seifert --- .github/workflows/main.yml | 4 +++- tools/get-version.py | 4 ++-- tox.ini | 8 +------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4132cdc6..7fd0e689 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,9 +38,11 @@ jobs: run: check-wheel-contents dist/*.whl - name: Check long_description run: python -m twine check dist/* + - name: Install pytest-asyncio + run: pip install . - name: Get version info id: version - run: tox -e version-info + run: python ./tools/get-version.py >> $GITHUB_OUTPUT - name: Upload artifacts uses: actions/upload-artifact@v3 with: diff --git a/tools/get-version.py b/tools/get-version.py index e988a32c..c29081b9 100644 --- a/tools/get-version.py +++ b/tools/get-version.py @@ -8,9 +8,9 @@ def main(): version_string = metadata.version("pytest-asyncio") version = parse_version(version_string) - print(f"::set-output name=version::{version}") + print(f"version={version}") prerelease = json.dumps(version.is_prerelease) - print(f"::set-output name=prerelease::{prerelease}") + print(f"prerelease={prerelease}") if __name__ == "__main__": diff --git a/tox.ini b/tox.ini index e705d9a6..97c19143 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.14.0 -envlist = py37, py38, py39, py310, py311, lint, version-info, pytest-min +envlist = py37, py38, py39, py310, py311, lint, pytest-min isolated_build = true passenv = CI @@ -33,12 +33,6 @@ commands = allowlist_externals = make -[testenv:version-info] -deps = - packaging == 21.3 -commands = - python ./tools/get-version.py - [gh-actions] python = 3.7: py37, pytest-min