Skip to content

Commit 8d15ab1

Browse files
committed
Use pyproject.toml as Python version source
Python and Python-based tools are used in the development and maintenance of the project. A standardized version of Python is used for these operations. Poetry is used for Python package dependencies management. Poetry installs dependencies into a virtual environment. For this reason, the Poetry configuration includes a Python version number, which must match the correct version of Python for the project. This configuration is stored in the `pyproject.toml` file. Python is installed in the GitHub Actions runner environments using the "actions/setup-python" action, which also must be configured to install the correct version of Python. Previously the version number for use by the actions/setup-python action was defined in each workflow. This meant that we had multiple copies of the Python version information, all of which had to be kept in sync. Fortunately, support for using `pyproject.toml` as the source of version information for the "actions/setup-python" action was recently added. This means it is now possible for all components of the project infrastructure to get the Python version from a single source.
1 parent 0b7b195 commit 8d15ab1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/check-yaml-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
- name: Install Python
102102
uses: actions/setup-python@v5
103103
with:
104-
python-version: ${{ env.PYTHON_VERSION }}
104+
python-version-file: pyproject.toml
105105

106106
- name: Install Poetry
107107
run: pip install poetry

.github/workflows/spell-check-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install Python
5656
uses: actions/setup-python@v5
5757
with:
58-
python-version: ${{ env.PYTHON_VERSION }}
58+
python-version-file: pyproject.toml
5959

6060
- name: Install Poetry
6161
run: pip install poetry

0 commit comments

Comments
 (0)