Skip to content

Commit 398e50c

Browse files
Refactoring/92 update poetry to 2.1.2 (#93)
* Add security.md file * Relock dependencies to resolve CVE-2025-27516 for jinja2 * Add .idea to .gitignore * Update exasol-toolbox to 1.0.1 & related workflows * Update poetry run <command> to poetry run -- <command> for poetry 2.1+ compatibility * Update poetry to 2.1.2 * Switch generate_api to run project:fix command to align with ci check --------- Co-authored-by: Tun Loakthar <[email protected]>
1 parent 88d396c commit 398e50c

File tree

131 files changed

+2964
-3349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+2964
-3349
lines changed

.github/workflows/build-and-publish.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ jobs:
1010

1111
cd-job:
1212
name: Continuous Delivery
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
steps:
1515

1616
- name: SCM Checkout
1717
uses: actions/checkout@v4
1818

1919
- name: Setup Python & Poetry Environment
20-
uses: exasol/python-toolbox/.github/actions/[email protected]
21-
with:
22-
poetry-version: 2.0.1
20+
uses: exasol/python-toolbox/.github/actions/[email protected]
2321

2422
- name: Build Artifacts
2523
run: poetry build
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI/CD
1+
name: CD
22

33
on:
44
push:
@@ -11,15 +11,14 @@ jobs:
1111
name: Check Release Tag
1212
uses: ./.github/workflows/check-release-tag.yml
1313

14-
ci-job:
15-
name: Checks
16-
needs: [ check-tag-version-job ]
17-
uses: ./.github/workflows/checks.yml
18-
secrets: inherit
19-
2014
cd-job:
2115
name: Continuous Delivery
22-
needs: [ ci-job ]
2316
uses: ./.github/workflows/build-and-publish.yml
2417
secrets:
2518
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
19+
20+
publish-docs:
21+
needs: [ cd-job ]
22+
name: Publish Documentation
23+
uses: ./.github/workflows/gh-pages.yml
24+

.github/workflows/check-api-outdated.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
check-api-outdated:
1919
name: Check API Outdated
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
2121
strategy:
2222
fail-fast: false
2323

@@ -26,13 +26,12 @@ jobs:
2626
uses: actions/checkout@v4
2727

2828
- name: Setup Python & Poetry Environment
29-
uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0
29+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
3030
with:
31-
poetry-version: 2.0.1
3231
python-version: "3.10"
3332

3433
- name: Run Nox Task api:check-outdated
35-
run: poetry run nox -s api:check-outdated
34+
run: poetry run -- nox -s api:check-outdated
3635

3736
- name: Report Failure Status to Slack Channel
3837
if: ${{ failure() && github.event_name == 'schedule' }}

.github/workflows/check-release-tag.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ jobs:
77
check-tag-version-job:
88

99
name: Check Tag Version
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1111

1212
steps:
1313
- name: SCM Checkout
1414
uses: actions/checkout@v4
1515

1616
- name: Setup Python & Poetry Environment
17-
uses: exasol/python-toolbox/.github/actions/[email protected]
18-
with:
19-
poetry-version: 2.0.1
17+
uses: exasol/python-toolbox/.github/actions/[email protected]
2018

2119
- name: Check Tag Version
2220
# make sure the pushed/created tag matched the project version

.github/workflows/checks.yml

+98-37
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: Checks
22

3-
on: workflow_call
3+
on:
4+
workflow_call:
45

56
jobs:
67

7-
version-check-job:
8-
name: Version Check
9-
runs-on: ubuntu-latest
8+
Version-Check:
9+
name: Version
10+
runs-on: ubuntu-24.04
1011

1112
steps:
1213
- name: SCM Checkout
@@ -15,82 +16,142 @@ jobs:
1516
fetch-depth: 0
1617

1718
- name: Setup Python & Poetry Environment
18-
uses: exasol/python-toolbox/.github/actions/[email protected]
19-
with:
20-
poetry-version: 2.0.1
19+
uses: exasol/python-toolbox/.github/actions/[email protected]
2120

2221
- name: Check Version(s)
23-
run: poetry run version-check version.py
22+
run: poetry run -- version-check version.py
2423

25-
build-documentation-job:
26-
name: Build Documentation
27-
needs: [version-check-job]
28-
runs-on: ubuntu-latest
24+
Documentation:
25+
name: Docs
26+
needs: [ Version-Check ]
27+
runs-on: ubuntu-24.04
2928

3029
steps:
3130
- name: SCM Checkout
3231
uses: actions/checkout@v4
3332

3433
- name: Setup Python & Poetry Environment
35-
uses: exasol/python-toolbox/.github/actions/[email protected]
36-
with:
37-
poetry-version: 2.0.1
34+
uses: exasol/python-toolbox/.github/actions/[email protected]
3835

3936
- name: Build Documentation
4037
run: |
41-
poetry run python -m nox -s docs:build
38+
poetry run -- nox -s docs:build
39+
40+
build-matrix:
41+
name: Generate Build Matrix
42+
uses: ./.github/workflows/matrix-python.yml
43+
44+
Changelog:
45+
name: Changelog Update Check
46+
runs-on: ubuntu-24.04
47+
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}
48+
49+
steps:
50+
- name: SCM Checkout
51+
uses: actions/checkout@v4
52+
53+
- name: Setup Python & Poetry Environment
54+
uses: exasol/python-toolbox/.github/actions/[email protected]
55+
56+
- name: Run changelog update check
57+
run: poetry run -- nox -s changelog:updated
4258

43-
lint-job:
59+
Lint:
4460
name: Linting (Python-${{ matrix.python-version }})
45-
needs: [version-check-job]
46-
runs-on: ubuntu-latest
61+
needs: [ Version-Check, build-matrix ]
62+
runs-on: ubuntu-24.04
4763
strategy:
4864
fail-fast: false
49-
matrix:
50-
python-version: ["3.10"]
65+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
5166

5267
steps:
5368
- name: SCM Checkout
5469
uses: actions/checkout@v4
5570

5671
- name: Setup Python & Poetry Environment
57-
uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0
72+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
5873
with:
59-
poetry-version: 2.0.1
6074
python-version: ${{ matrix.python-version }}
6175

62-
- name: Run Tests
63-
run: poetry run nox -s lint:code
76+
- name: Run lint
77+
run: poetry run -- nox -s lint:code
6478

65-
type-check-job:
79+
- name: Upload Artifacts
80+
uses: actions/[email protected]
81+
with:
82+
name: lint-python${{ matrix.python-version }}
83+
path: |
84+
.lint.txt
85+
.lint.json
86+
include-hidden-files: true
87+
88+
Type-Check:
6689
name: Type Checking (Python-${{ matrix.python-version }})
67-
needs: [version-check-job]
68-
runs-on: ubuntu-latest
90+
needs: [ Version-Check, build-matrix ]
91+
runs-on: ubuntu-24.04
6992
strategy:
7093
fail-fast: false
71-
matrix:
72-
python-version: ["3.10"]
94+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
7395

7496
steps:
7597
- name: SCM Checkout
7698
uses: actions/checkout@v4
7799

78100
- name: Setup Python & Poetry Environment
79-
uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0
101+
uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1
80102
with:
81-
poetry-version: 2.0.1
82103
python-version: ${{ matrix.python-version }}
83104

84-
- name: Run Tests
85-
run: poetry run nox -s lint:typing
105+
- name: Run type-check
106+
run: poetry run -- nox -s lint:typing
107+
108+
Security:
109+
name: Security Checks (Python-${{ matrix.python-version }})
110+
needs: [ Version-Check, build-matrix ]
111+
runs-on: ubuntu-24.04
112+
strategy:
113+
fail-fast: false
114+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
115+
116+
steps:
117+
- name: SCM Checkout
118+
uses: actions/checkout@v4
119+
120+
- name: Setup Python & Poetry Environment
121+
uses: exasol/python-toolbox/.github/actions/[email protected]
122+
with:
123+
python-version: ${{ matrix.python-version }}
124+
125+
- name: Run security linter
126+
run: poetry run -- nox -s lint:security
127+
128+
- name: Upload Artifacts
129+
uses: actions/[email protected]
130+
with:
131+
name: security-python${{ matrix.python-version }}
132+
path: .security.json
133+
include-hidden-files: true
134+
135+
Format:
136+
name: Format Check
137+
runs-on: ubuntu-24.04
138+
139+
steps:
140+
- name: SCM Checkout
141+
uses: actions/checkout@v4
142+
143+
- name: Setup Python & Poetry Environment
144+
uses: exasol/python-toolbox/.github/actions/[email protected]
145+
146+
- name: Run format check
147+
run: poetry run -- nox -s project:format
86148

87149
tests-job:
88150
name: Tests (Python-${{ matrix.python-version }})
89-
needs: [build-documentation-job, lint-job, type-check-job]
151+
needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ]
90152
strategy:
91153
fail-fast: false
92-
matrix:
93-
python-version: ["3.10"]
154+
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
94155
uses: ./.github/workflows/run-tests.yml
95156
secrets: inherit
96157
with:

.github/workflows/ci.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
name: CI
22

33
on:
4-
pull_request:
4+
push:
5+
branches-ignore:
6+
- "github-pages/*"
7+
- "gh-pages/*"
8+
- "main"
9+
- "master"
510

611
jobs:
712

@@ -17,14 +22,14 @@ jobs:
1722
gate-1:
1823
name: Gate 1 - Regular CI
1924
needs: [ ci-job ]
20-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-24.04
2126
steps:
2227
- name: Branch Protection
2328
run: true
2429

2530
slow-test-detection:
2631
name: Run Slow or Expensive Tests (e.g. SaaS)?
27-
runs-on: ubuntu-latest
32+
runs-on: ubuntu-24.04
2833
steps:
2934
- name: Detect Slow Tests
3035
run: true
@@ -42,7 +47,7 @@ jobs:
4247

4348
gate-2:
4449
name: Gate 2 - Allow Merge
45-
runs-on: ubuntu-latest
50+
runs-on: ubuntu-24.04
4651
needs: [ run-slow-tests ]
4752
steps:
4853
- name: Branch Protection

.github/workflows/gh-pages.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
name: Publish Documentation
22

3-
on: workflow_call
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
46

57
jobs:
68

79
documentation-job:
8-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
911

1012
steps:
1113
- name: SCM Checkout
1214
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
1317

1418
- name: Setup Python & Poetry Environment
15-
uses: exasol/python-toolbox/.github/actions/[email protected]
16-
with:
17-
poetry-version: 2.0.1
19+
uses: exasol/python-toolbox/.github/actions/[email protected]
1820

1921
- name: Build Documentation
2022
run: |
21-
poetry run python -m nox -s docs:build
23+
poetry run -- nox -s docs:multiversion
2224
2325
- name: Deploy
24-
uses: JamesIves/github-pages-deploy-action@v4.4.1
26+
uses: JamesIves/github-pages-deploy-action@v4.7.2
2527
with:
2628
branch: gh-pages
2729
folder: .html-documentation

.github/workflows/matrix-python.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Matrix (Python)
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
matrix:
7+
description: "Generates the python version build matrix"
8+
value: ${{ jobs.python_versions.outputs.matrix }}
9+
10+
jobs:
11+
python_versions:
12+
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- name: SCM Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python & Poetry Environment
20+
uses: exasol/python-toolbox/.github/actions/[email protected]
21+
22+
- name: Generate matrix
23+
run: poetry run -- nox -s matrix:python
24+
25+
- id: set-matrix
26+
run: |
27+
echo "matrix=$(poetry run -- nox -s matrix:python)" >> $GITHUB_OUTPUT
28+
29+
outputs:
30+
matrix: ${{ steps.set-matrix.outputs.matrix }}

0 commit comments

Comments
 (0)