Skip to content

Commit

Permalink
Remove use of deprecated ::set-output GitHub command (pytest-dev#466)
Browse files Browse the repository at this point in the history
* [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 pytest-dev#429

Signed-off-by: Michael Seifert <[email protected]>

* [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 <[email protected]>

* [refactor] Removed obsolete "version-info" tox environment.

Signed-off-by: Michael Seifert <[email protected]>

Signed-off-by: Michael Seifert <[email protected]>
  • Loading branch information
seifertm authored Dec 22, 2022
1 parent 57c70d8 commit 99cfd71
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tools/get-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
8 changes: 1 addition & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 99cfd71

Please sign in to comment.