Skip to content

Commit bea95cb

Browse files
mishushakovclaude
andcommitted
Use .tool-versions for Python and Poetry versions in workflows
Add a .tool-versions file (python 3.13, poetry 1.8.1) and use wistia/parse-tool-versions to read versions in all workflows, replacing hardcoded version strings with env var references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 03b8306 commit bea95cb

File tree

8 files changed

+90
-17
lines changed

8 files changed

+90
-17
lines changed

.github/workflows/build_test_template.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ jobs:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
2929

30+
- name: Parse .tool-versions
31+
uses: wistia/parse-tool-versions@v2.1.1
32+
with:
33+
filename: '.tool-versions'
34+
uppercase: 'true'
35+
prefix: 'tool_version_'
36+
3037
- name: Set package version
3138
working-directory: ./template
3239
run: |
@@ -36,7 +43,7 @@ jobs:
3643
3744
- uses: actions/setup-python@v6
3845
with:
39-
python-version: '3.13'
46+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
4047

4148
- name: Install development dependencies
4249
working-directory: ./template

.github/workflows/charts_tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,22 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20+
- name: Parse .tool-versions
21+
uses: wistia/parse-tool-versions@v2.1.1
22+
with:
23+
filename: '.tool-versions'
24+
uppercase: 'true'
25+
prefix: 'tool_version_'
26+
2027
- name: Set up Python
2128
uses: actions/setup-python@v6
2229
with:
23-
python-version: '3.13'
30+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
2431

2532
- name: Install and configure Poetry
2633
uses: snok/install-poetry@v1
2734
with:
28-
version: 1.5.1
35+
version: '${{ env.TOOL_VERSION_POETRY }}'
2936
virtualenvs-create: true
3037
virtualenvs-in-project: true
3138
installer-parallel: true

.github/workflows/lint.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ jobs:
1212
- name: Checkout Repo
1313
uses: actions/checkout@v4
1414

15+
- name: Parse .tool-versions
16+
uses: wistia/parse-tool-versions@v2.1.1
17+
with:
18+
filename: '.tool-versions'
19+
uppercase: 'true'
20+
prefix: 'tool_version_'
21+
1522
- uses: pnpm/action-setup@v4
1623
with:
1724
version: 9.15.5
@@ -33,12 +40,12 @@ jobs:
3340
- name: Set up Python
3441
uses: actions/setup-python@v6
3542
with:
36-
python-version: '3.13'
43+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
3744

3845
- name: Install and configure Poetry
3946
uses: snok/install-poetry@v1
4047
with:
41-
version: 1.5.1
48+
version: '${{ env.TOOL_VERSION_POETRY }}'
4249
virtualenvs-create: true
4350
virtualenvs-in-project: true
4451
installer-parallel: true

.github/workflows/performance_tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,22 @@ jobs:
3131
- name: Checkout repository
3232
uses: actions/checkout@v4
3333

34+
- name: Parse .tool-versions
35+
uses: wistia/parse-tool-versions@v2.1.1
36+
with:
37+
filename: '.tool-versions'
38+
uppercase: 'true'
39+
prefix: 'tool_version_'
40+
3441
- name: Set up Python
3542
uses: actions/setup-python@v6
3643
with:
37-
python-version: '3.13'
44+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
3845

3946
- name: Install and configure Poetry
4047
uses: snok/install-poetry@v1
4148
with:
42-
version: 1.5.1
49+
version: '${{ env.TOOL_VERSION_POETRY }}'
4350
virtualenvs-create: true
4451
virtualenvs-in-project: true
4552
installer-parallel: true

.github/workflows/python_tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,22 @@ jobs:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
2929

30+
- name: Parse .tool-versions
31+
uses: wistia/parse-tool-versions@v2.1.1
32+
with:
33+
filename: '.tool-versions'
34+
uppercase: 'true'
35+
prefix: 'tool_version_'
36+
3037
- name: Set up Python
3138
uses: actions/setup-python@v6
3239
with:
33-
python-version: '3.13'
40+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
3441

3542
- name: Install and configure Poetry
3643
uses: snok/install-poetry@v1
3744
with:
38-
version: 1.5.1
45+
version: '${{ env.TOOL_VERSION_POETRY }}'
3946
virtualenvs-create: true
4047
virtualenvs-in-project: true
4148
installer-parallel: true

.github/workflows/release.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ jobs:
119119
- name: Checkout Repo
120120
uses: actions/checkout@v4
121121

122+
- name: Parse .tool-versions
123+
uses: wistia/parse-tool-versions@v2.1.1
124+
with:
125+
filename: '.tool-versions'
126+
uppercase: 'true'
127+
prefix: 'tool_version_'
128+
122129
- name: Install pnpm
123130
uses: pnpm/action-setup@v3
124131
id: pnpm-install
@@ -128,12 +135,12 @@ jobs:
128135
- name: Set up Python
129136
uses: actions/setup-python@v6
130137
with:
131-
python-version: "3.13"
138+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
132139

133140
- name: Install and configure Poetry
134141
uses: snok/install-poetry@v1
135142
with:
136-
version: 1.5.1
143+
version: '${{ env.TOOL_VERSION_POETRY }}'
137144
virtualenvs-create: true
138145
virtualenvs-in-project: true
139146
installer-parallel: true
@@ -179,6 +186,13 @@ jobs:
179186
- name: Checkout repository
180187
uses: actions/checkout@v4
181188

189+
- name: Parse .tool-versions
190+
uses: wistia/parse-tool-versions@v2.1.1
191+
with:
192+
filename: '.tool-versions'
193+
uppercase: 'true'
194+
prefix: 'tool_version_'
195+
182196
- name: Set up Docker Buildx
183197
uses: docker/setup-buildx-action@v3
184198

@@ -202,7 +216,7 @@ jobs:
202216
203217
- uses: actions/setup-python@v6
204218
with:
205-
python-version: '3.13'
219+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
206220

207221
- name: Install development dependencies
208222
working-directory: ./template
@@ -227,9 +241,17 @@ jobs:
227241
steps:
228242
- name: Checkout repository
229243
uses: actions/checkout@v4
244+
245+
- name: Parse .tool-versions
246+
uses: wistia/parse-tool-versions@v2.1.1
247+
with:
248+
filename: '.tool-versions'
249+
uppercase: 'true'
250+
prefix: 'tool_version_'
251+
230252
- uses: actions/setup-python@v6
231253
with:
232-
python-version: '3.13'
254+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
233255

234256
- name: Install development dependencies
235257
working-directory: ./template
@@ -284,15 +306,22 @@ jobs:
284306
with:
285307
token: ${{ steps.app-token.outputs.token }}
286308

309+
- name: Parse .tool-versions
310+
uses: wistia/parse-tool-versions@v2.1.1
311+
with:
312+
filename: '.tool-versions'
313+
uppercase: 'true'
314+
prefix: 'tool_version_'
315+
287316
- name: Set up Python
288317
uses: actions/setup-python@v6
289318
with:
290-
python-version: "3.13"
319+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
291320

292321
- name: Install and configure Poetry
293322
uses: snok/install-poetry@v1
294323
with:
295-
version: 1.8.1
324+
version: '${{ env.TOOL_VERSION_POETRY }}'
296325
virtualenvs-create: true
297326
virtualenvs-in-project: true
298327
installer-parallel: true

.github/workflows/release_candidates.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ jobs:
1717
with:
1818
ref: ${{ github.head_ref }}
1919

20+
- name: Parse .tool-versions
21+
uses: wistia/parse-tool-versions@v2.1.1
22+
with:
23+
filename: '.tool-versions'
24+
uppercase: 'true'
25+
prefix: 'tool_version_'
26+
2027
- uses: pnpm/action-setup@v3
2128
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') }}
2229
with:
@@ -61,13 +68,13 @@ jobs:
6168
uses: actions/setup-python@v6
6269
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}
6370
with:
64-
python-version: "3.13"
71+
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
6572

6673
- name: Install and configure Poetry
6774
uses: snok/install-poetry@v1
6875
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}
6976
with:
70-
version: 1.8.1
77+
version: '${{ env.TOOL_VERSION_POETRY }}'
7178
virtualenvs-create: true
7279
virtualenvs-in-project: true
7380
installer-parallel: true

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python 3.13
2+
poetry 1.8.1

0 commit comments

Comments
 (0)