Skip to content

Commit 548cbf9

Browse files
authored
Merge pull request #599 from per1234/pyproject_toml-versioning
Use pyproject.toml as Python version source
2 parents 364143b + 5560370 commit 548cbf9

16 files changed

+19
-75
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md
22
name: Check Python
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -73,7 +69,7 @@ jobs:
7369
- name: Install Python
7470
uses: actions/setup-python@v5
7571
with:
76-
python-version: ${{ env.PYTHON_VERSION }}
72+
python-version-file: pyproject.toml
7773

7874
- name: Install Poetry
7975
run: pip install poetry
@@ -104,7 +100,7 @@ jobs:
104100
- name: Install Python
105101
uses: actions/setup-python@v5
106102
with:
107-
python-version: ${{ env.PYTHON_VERSION }}
103+
python-version-file: pyproject.toml
108104

109105
- name: Install Poetry
110106
run: pip install poetry

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-yaml-task.md
22
name: Check YAML
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -101,7 +97,7 @@ jobs:
10197
- name: Install Python
10298
uses: actions/setup-python@v5
10399
with:
104-
python-version: ${{ env.PYTHON_VERSION }}
100+
python-version-file: pyproject.toml
105101

106102
- name: Install Poetry
107103
run: pip install poetry

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md
22
name: Spell Check
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -55,7 +51,7 @@ jobs:
5551
- name: Install Python
5652
uses: actions/setup-python@v5
5753
with:
58-
python-version: ${{ env.PYTHON_VERSION }}
54+
python-version-file: pyproject.toml
5955

6056
- name: Install Poetry
6157
run: pip install poetry

.github/workflows/test-python-poetry-task.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-python-poetry-task.md
22
name: Test Python
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -69,7 +65,7 @@ jobs:
6965
- name: Install Python
7066
uses: actions/setup-python@v5
7167
with:
72-
python-version: ${{ env.PYTHON_VERSION }}
68+
python-version-file: pyproject.toml
7369

7470
- name: Install Poetry
7571
run: pip install poetry

docs/development.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ The following development tools must be available in your local environment:
99
- [**Node.js** / **npm**](https://nodejs.org/en/download/) - Node.js dependencies management tool
1010
- The **Node.js** version in use is defined by the `engines.node` key of [`package.json`](../package.json).
1111
- [**Python**](https://wiki.python.org/moin/BeginnersGuide/Download)
12-
- <!-- PYTHON_VERSION -->
13-
This project uses Python 3.9.x
12+
- The **Python** version in use is defined by the `tool.poetry.dependencies.python` key of [`pyproject.toml`](../pyproject.toml).
1413
- [**Poetry**](https://python-poetry.org/docs/#installation) - Python dependencies management tool
1514
- [**Task**](https://taskfile.dev/installation/) - task runner tool
1615

poetry.lock

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = ""
88
authors = ["Arduino <[email protected]>"]
99

1010
[tool.poetry.dependencies]
11-
python = "^3.9"
11+
python = "~3.9"
1212

1313
[tool.poetry.dev-dependencies]
1414
yamllint = "^v1.37.1"

workflow-templates/check-mkdocs-task.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
22
name: Check Website
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -69,7 +65,7 @@ jobs:
6965
- name: Install Python
7066
uses: actions/setup-python@v5
7167
with:
72-
python-version: ${{ env.PYTHON_VERSION }}
68+
python-version-file: pyproject.toml
7369

7470
- name: Install Poetry
7571
run: pip install poetry

workflow-templates/check-python-task.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md
22
name: Check Python
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -73,7 +69,7 @@ jobs:
7369
- name: Install Python
7470
uses: actions/setup-python@v5
7571
with:
76-
python-version: ${{ env.PYTHON_VERSION }}
72+
python-version-file: pyproject.toml
7773

7874
- name: Install Poetry
7975
run: pip install poetry
@@ -104,7 +100,7 @@ jobs:
104100
- name: Install Python
105101
uses: actions/setup-python@v5
106102
with:
107-
python-version: ${{ env.PYTHON_VERSION }}
103+
python-version-file: pyproject.toml
108104

109105
- name: Install Poetry
110106
run: pip install poetry

workflow-templates/check-yaml-task.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-yaml-task.md
22
name: Check YAML
33

4-
env:
5-
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
6-
PYTHON_VERSION: "3.9"
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
create:
@@ -101,7 +97,7 @@ jobs:
10197
- name: Install Python
10298
uses: actions/setup-python@v5
10399
with:
104-
python-version: ${{ env.PYTHON_VERSION }}
100+
python-version-file: pyproject.toml
105101

106102
- name: Install Poetry
107103
run: pip install poetry

0 commit comments

Comments
 (0)