From d20c2737d59495858045600c174795895662df75 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 8 Jun 2022 18:15:56 +0100 Subject: [PATCH] python: Utilis setup-python's new `python-version-file` This way we only need to edit `.python-version` and all the GitHub actions will automatically use that version. --- .github/workflows/pr-checks.yml | 4 ++-- .github/workflows/push-checks.yml | 4 ++-- .github/workflows/windows-build.yml | 2 +- docs/Releasing.md | 10 ++++------ 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 62ca8b45..55ee97ff 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -52,10 +52,10 @@ jobs: #################################################################### # Get Python set up #################################################################### - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version-file: '.python-version' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/push-checks.yml b/.github/workflows/push-checks.yml index 86556e49..298bd4ff 100644 --- a/.github/workflows/push-checks.yml +++ b/.github/workflows/push-checks.yml @@ -20,10 +20,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version-file: '.python-version' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 4140d956..122ffd6d 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.10.4" + python-version-file: '.python-version' architecture: "x86" - name: Install python tools diff --git a/docs/Releasing.md b/docs/Releasing.md index 2756f2fe..f691ee69 100644 --- a/docs/Releasing.md +++ b/docs/Releasing.md @@ -433,13 +433,13 @@ If you are making a pre-release then: When changing the Python version (Major.Minor.Patch) used: -1. Change the contents of `.python-version` so that pyenv notices. +1. Change the contents of `.python-version` so that pyenv notices. All of + the GitHub workflows now reference this via the `setup-python` + `python-version-file` directive. 1. Any version change: - 1. `.github/workflows/windows-build.yml` needs updating to have the GitHub - based build use the correct version. - 2. `ChangeLog.md` - The `We now test against, and package with, Python + 1. `ChangeLog.md` - The `We now test against, and package with, Python M.m.P.` line. 1. Major or Minor level changes: @@ -449,5 +449,3 @@ When changing the Python version (Major.Minor.Patch) used: pythonXX.dll file. 3. `.pre-commit-config.yaml` will need the `default_language_version` section updated to the appropriate version. - 4. All `.github/workflows/` files will need to be citing the correct - version in any `uses: actions/setup-python` section.