Skip to content

Commit 0e1b485

Browse files
authored
Feature/673 move matrix python to jinja (#674)
* Add python_version to output in github_template_dict * Modify checks.yml to no longer use build-matrix from matrix:python
1 parent 8fd9166 commit 0e1b485

5 files changed

Lines changed: 58 additions & 50 deletions

File tree

.github/workflows/checks.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ jobs:
4848
run: |
4949
poetry run -- nox -s links:check
5050
51-
build-matrix:
52-
name: Generate Build Matrix
53-
uses: ./.github/workflows/matrix-python.yml
54-
permissions:
55-
contents: read
56-
5751
Changelog:
5852
name: Changelog Update Check
5953
runs-on: "ubuntu-24.04"
@@ -74,22 +68,23 @@ jobs:
7468
run: poetry run -- nox -s changelog:updated
7569

7670
Lint:
77-
name: Linting (Python-${{ matrix.python-version }})
78-
needs: [ Version-Check, build-matrix ]
71+
name: Linting (Python-${{ matrix.python-versions }})
72+
needs: [ Version-Check ]
7973
runs-on: "ubuntu-24.04"
8074
permissions:
8175
contents: read
8276
strategy:
8377
fail-fast: false
84-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
78+
matrix:
79+
python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"]
8580
steps:
8681
- name: SCM Checkout
8782
uses: actions/checkout@v6
8883

8984
- name: Setup Python & Poetry Environment
9085
uses: ./.github/actions/python-environment
9186
with:
92-
python-version: ${{ matrix.python-version }}
87+
python-version: ${{ matrix.python-versions }}
9388
poetry-version: "2.3.0"
9489

9590
- name: Run lint
@@ -98,21 +93,22 @@ jobs:
9893
- name: Upload Artifacts
9994
uses: actions/upload-artifact@v6
10095
with:
101-
name: lint-python${{ matrix.python-version }}
96+
name: lint-python${{ matrix.python-versions }}
10297
path: |
10398
.lint.txt
10499
.lint.json
105100
include-hidden-files: true
106101

107102
Type-Check:
108-
name: Type Checking (Python-${{ matrix.python-version }})
109-
needs: [ Version-Check, build-matrix ]
103+
name: Type Checking (Python-${{ matrix.python-versions }})
104+
needs: [ Version-Check ]
110105
runs-on: "ubuntu-24.04"
111106
permissions:
112107
contents: read
113108
strategy:
114109
fail-fast: false
115-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
110+
matrix:
111+
python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"]
116112

117113
steps:
118114
- name: SCM Checkout
@@ -121,21 +117,22 @@ jobs:
121117
- name: Setup Python & Poetry Environment
122118
uses: ./.github/actions/python-environment
123119
with:
124-
python-version: ${{ matrix.python-version }}
120+
python-version: ${{ matrix.python-versions }}
125121
poetry-version: "2.3.0"
126122

127123
- name: Run type-check
128124
run: poetry run -- nox -s lint:typing
129125

130126
Security:
131-
name: Security Checks (Python-${{ matrix.python-version }})
132-
needs: [ Version-Check, build-matrix ]
127+
name: Security Checks (Python-${{ matrix.python-versions }})
128+
needs: [ Version-Check ]
133129
runs-on: "ubuntu-24.04"
134130
permissions:
135131
contents: read
136132
strategy:
137133
fail-fast: false
138-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
134+
matrix:
135+
python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"]
139136

140137
steps:
141138
- name: SCM Checkout
@@ -144,7 +141,7 @@ jobs:
144141
- name: Setup Python & Poetry Environment
145142
uses: ./.github/actions/python-environment
146143
with:
147-
python-version: ${{ matrix.python-version }}
144+
python-version: ${{ matrix.python-versions }}
148145
poetry-version: "2.3.0"
149146

150147
- name: Run security linter
@@ -153,7 +150,7 @@ jobs:
153150
- name: Upload Artifacts
154151
uses: actions/upload-artifact@v6
155152
with:
156-
name: security-python${{ matrix.python-version }}
153+
name: security-python${{ matrix.python-versions }}
157154
path: .security.json
158155
include-hidden-files: true
159156

@@ -214,14 +211,15 @@ jobs:
214211
run: poetry run -- nox -s lint:import
215212

216213
Tests:
217-
name: Unit-Tests (Python-${{ matrix.python-version }})
218-
needs: [ Build-Packages, Lint-Imports, build-matrix ]
214+
name: Unit-Tests (Python-${{ matrix.python-versions }})
215+
needs: [ Build-Packages, Lint-Imports ]
219216
runs-on: "ubuntu-24.04"
220217
permissions:
221218
contents: read
222219
strategy:
223220
fail-fast: false
224-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
221+
matrix:
222+
python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"]
225223

226224
steps:
227225
- name: SCM Checkout
@@ -233,7 +231,7 @@ jobs:
233231
- name: Setup Python & Poetry Environment
234232
uses: ./.github/actions/python-environment
235233
with:
236-
python-version: ${{ matrix.python-version }}
234+
python-version: ${{ matrix.python-versions }}
237235
poetry-version: "2.3.0"
238236

239237
- name: Run Tests and Collect Coverage
@@ -242,6 +240,6 @@ jobs:
242240
- name: Upload Artifacts
243241
uses: actions/upload-artifact@v6
244242
with:
245-
name: coverage-python${{ matrix.python-version }}-fast
243+
name: coverage-python${{ matrix.python-versions }}-fast
246244
path: .coverage
247245
include-hidden-files: true

doc/changes/unreleased.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Unreleased
22

33
## Summary
4+
5+
## Feature
6+
7+
* #673: Switched `checks.yml` to get Python versions for matrix from `BaseConfig`

exasol/toolbox/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,5 @@ def github_template_dict(self) -> dict[str, Any]:
277277
"dependency_manager_version": self.dependency_manager.version,
278278
"minimum_python_version": self.minimum_python_version,
279279
"os_version": self.os_version,
280+
"python_versions": self.python_versions,
280281
}

exasol/toolbox/templates/github/workflows/checks.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ jobs:
4848
run: |
4949
poetry run -- nox -s links:check
5050
51-
build-matrix:
52-
name: Generate Build Matrix
53-
uses: ./.github/workflows/matrix-python.yml
54-
permissions:
55-
contents: read
56-
5751
Changelog:
5852
name: Changelog Update Check
5953
runs-on: "(( os_version ))"
@@ -74,22 +68,23 @@ jobs:
7468
run: poetry run -- nox -s changelog:updated
7569

7670
Lint:
77-
name: Linting (Python-${{ matrix.python-version }})
78-
needs: [ Version-Check, build-matrix ]
71+
name: Linting (Python-${{ matrix.python-versions }})
72+
needs: [ Version-Check ]
7973
runs-on: "(( os_version ))"
8074
permissions:
8175
contents: read
8276
strategy:
8377
fail-fast: false
84-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
78+
matrix:
79+
python-versions: (( python_versions | tojson ))
8580
steps:
8681
- name: SCM Checkout
8782
uses: actions/checkout@v6
8883

8984
- name: Setup Python & Poetry Environment
9085
uses: exasol/python-toolbox/.github/actions/python-environment@v5
9186
with:
92-
python-version: ${{ matrix.python-version }}
87+
python-version: ${{ matrix.python-versions }}
9388
poetry-version: "(( dependency_manager_version ))"
9489

9590
- name: Run lint
@@ -98,21 +93,22 @@ jobs:
9893
- name: Upload Artifacts
9994
uses: actions/upload-artifact@v6
10095
with:
101-
name: lint-python${{ matrix.python-version }}
96+
name: lint-python${{ matrix.python-versions }}
10297
path: |
10398
.lint.txt
10499
.lint.json
105100
include-hidden-files: true
106101

107102
Type-Check:
108-
name: Type Checking (Python-${{ matrix.python-version }})
109-
needs: [ Version-Check, build-matrix ]
103+
name: Type Checking (Python-${{ matrix.python-versions }})
104+
needs: [ Version-Check ]
110105
runs-on: "(( os_version ))"
111106
permissions:
112107
contents: read
113108
strategy:
114109
fail-fast: false
115-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
110+
matrix:
111+
python-versions: (( python_versions | tojson ))
116112

117113
steps:
118114
- name: SCM Checkout
@@ -121,21 +117,22 @@ jobs:
121117
- name: Setup Python & Poetry Environment
122118
uses: exasol/python-toolbox/.github/actions/python-environment@v5
123119
with:
124-
python-version: ${{ matrix.python-version }}
120+
python-version: ${{ matrix.python-versions }}
125121
poetry-version: "(( dependency_manager_version ))"
126122

127123
- name: Run type-check
128124
run: poetry run -- nox -s lint:typing
129125

130126
Security:
131-
name: Security Checks (Python-${{ matrix.python-version }})
132-
needs: [ Version-Check, build-matrix ]
127+
name: Security Checks (Python-${{ matrix.python-versions }})
128+
needs: [ Version-Check ]
133129
runs-on: "(( os_version ))"
134130
permissions:
135131
contents: read
136132
strategy:
137133
fail-fast: false
138-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
134+
matrix:
135+
python-versions: (( python_versions | tojson ))
139136

140137
steps:
141138
- name: SCM Checkout
@@ -144,7 +141,7 @@ jobs:
144141
- name: Setup Python & Poetry Environment
145142
uses: exasol/python-toolbox/.github/actions/python-environment@v5
146143
with:
147-
python-version: ${{ matrix.python-version }}
144+
python-version: ${{ matrix.python-versions }}
148145
poetry-version: "(( dependency_manager_version ))"
149146

150147
- name: Run security linter
@@ -153,7 +150,7 @@ jobs:
153150
- name: Upload Artifacts
154151
uses: actions/upload-artifact@v6
155152
with:
156-
name: security-python${{ matrix.python-version }}
153+
name: security-python${{ matrix.python-versions }}
157154
path: .security.json
158155
include-hidden-files: true
159156

@@ -196,14 +193,15 @@ jobs:
196193
run: poetry run -- nox -s package:check
197194

198195
Tests:
199-
name: Unit-Tests (Python-${{ matrix.python-version }})
200-
needs: [ Build-Packages, build-matrix ]
196+
name: Unit-Tests (Python-${{ matrix.python-versions }})
197+
needs: [ Build-Packages ]
201198
runs-on: "(( os_version ))"
202199
permissions:
203200
contents: read
204201
strategy:
205202
fail-fast: false
206-
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
203+
matrix:
204+
python-versions: (( python_versions | tojson ))
207205

208206
steps:
209207
- name: SCM Checkout
@@ -212,7 +210,7 @@ jobs:
212210
- name: Setup Python & Poetry Environment
213211
uses: exasol/python-toolbox/.github/actions/python-environment@v5
214212
with:
215-
python-version: ${{ matrix.python-version }}
213+
python-version: ${{ matrix.python-versions }}
216214
poetry-version: "(( dependency_manager_version ))"
217215

218216
- name: Run Tests and Collect Coverage
@@ -221,6 +219,6 @@ jobs:
221219
- name: Upload Artifacts
222220
uses: actions/upload-artifact@v6
223221
with:
224-
name: coverage-python${{ matrix.python-version }}-fast
222+
name: coverage-python${{ matrix.python-versions }}-fast
225223
path: .coverage
226224
include-hidden-files: true

test/unit/config_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ def test_works_as_defined(test_project_config_factory):
3838
"dependency_manager_version": "2.3.0",
3939
"minimum_python_version": "3.10",
4040
"os_version": "ubuntu-24.04",
41+
"python_versions": (
42+
"3.10",
43+
"3.11",
44+
"3.12",
45+
"3.13",
46+
"3.14",
47+
),
4148
},
4249
"minimum_python_version": "3.10",
4350
"os_version": "ubuntu-24.04",

0 commit comments

Comments
 (0)