Skip to content

Commit 95f0402

Browse files
authored
Refactoring/376 update to poetry v2 (#394)
* Update to poetry 2.1.2 * Update to poetry 2.1+ changes to 'poetry run -- command -- --cli-arg' See discussion and related changes in: python-poetry/poetry#10204 * Add another author to the project
1 parent fa52dcb commit 95f0402

File tree

28 files changed

+595
-484
lines changed

28 files changed

+595
-484
lines changed

.github/actions/python-environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
poetry-version:
1212
description: 'Poetry version to use'
1313
required: true
14-
default: "1.2.2"
14+
default: "2.1.2"
1515

1616
runs:
1717

.github/workflows/checks.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: ./.github/actions/python-environment
2020

2121
- name: Check Version(s)
22-
run: poetry run version-check `poetry run python -c "from noxconfig import PROJECT_CONFIG; print(PROJECT_CONFIG.version_file)"`
22+
run: poetry run version-check `poetry run -- python -c "from noxconfig import PROJECT_CONFIG; print(PROJECT_CONFIG.version_file)"`
2323

2424
Documentation:
2525
name: Docs
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Build Documentation
3737
run: |
38-
poetry run python -m nox -s docs:build
38+
poetry run -- nox -s docs:build
3939
4040
Changelog:
4141
name: Changelog Update Check
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Run changelog update check
5757
if: ${{ github.ref != 'refs/heads/main' }}
58-
run: poetry run nox -s changelog:updated
58+
run: poetry run -- nox -s changelog:updated
5959

6060
build-matrix:
6161
name: Generate Build Matrix
@@ -79,7 +79,7 @@ jobs:
7979
python-version: ${{ matrix.python-version }}
8080

8181
- name: Run lint
82-
run: poetry run nox -s lint:code
82+
run: poetry run -- nox -s lint:code
8383

8484
- name: Upload Artifacts
8585
uses: actions/upload-artifact@v4.6.0
@@ -108,7 +108,7 @@ jobs:
108108
python-version: ${{ matrix.python-version }}
109109

110110
- name: Run type-check
111-
run: poetry run nox -s lint:typing
111+
run: poetry run -- nox -s lint:typing
112112

113113
Security:
114114
name: Security Checks (Python-${{ matrix.python-version }})
@@ -128,7 +128,7 @@ jobs:
128128
python-version: ${{ matrix.python-version }}
129129

130130
- name: Run security linter
131-
run: poetry run nox -s lint:security
131+
run: poetry run -- nox -s lint:security
132132

133133
- name: Upload Artifacts
134134
uses: actions/upload-artifact@v4.6.0
@@ -151,7 +151,7 @@ jobs:
151151
python-version: "3.9"
152152

153153
- name: Run format check
154-
run: poetry run nox -s project:format
154+
run: poetry run -- nox -s project:format
155155

156156
Tests:
157157
name: Unit-Tests (Python-${{ matrix.python-version }})
@@ -173,7 +173,7 @@ jobs:
173173
python-version: ${{ matrix.python-version }}
174174

175175
- name: Run Tests and Collect Coverage
176-
run: poetry run nox -s test:unit -- -- --coverage
176+
run: poetry run -- nox -s test:unit -- --coverage
177177

178178
- name: Upload Artifacts
179179
uses: actions/upload-artifact@v4.6.0

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- name: Build Documentation
2222
run: |
23-
poetry run nox -s docs:multiversion
23+
poetry run -- nox -s docs:multiversion
2424
2525
- name: Deploy
2626
uses: JamesIves/github-pages-deploy-action@v4.7.2

.github/workflows/matrix-all.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
uses: ./.github/actions/python-environment
2121

2222
- name: Generate matrix
23-
run: poetry run nox -s matrix:all
23+
run: poetry run -- nox -s matrix:all
2424

2525
- id: set-matrix
2626
run: |
27-
echo "matrix=$(poetry run nox -s matrix:all)" >> $GITHUB_OUTPUT
27+
echo "matrix=$(poetry run -- nox -s matrix:all)" >> $GITHUB_OUTPUT
2828
2929
outputs:
3030
matrix: ${{ steps.set-matrix.outputs.matrix }}

.github/workflows/matrix-exasol.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
uses: ./.github/actions/python-environment
2121

2222
- name: Generate matrix
23-
run: poetry run nox -s matrix:exasol
23+
run: poetry run -- nox -s matrix:exasol
2424

2525
- id: set-matrix
2626
run: |
27-
echo "matrix=$(poetry run nox -s matrix:exasol)" >> $GITHUB_OUTPUT
27+
echo "matrix=$(poetry run -- nox -s matrix:exasol)" >> $GITHUB_OUTPUT
2828
2929
outputs:
3030
matrix: ${{ steps.set-matrix.outputs.matrix }}

.github/workflows/matrix-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
uses: ./.github/actions/python-environment
2121

2222
- name: Generate matrix
23-
run: poetry run nox -s matrix:python
23+
run: poetry run -- nox -s matrix:python
2424

2525
- id: set-matrix
2626
run: |
27-
echo "matrix=$(poetry run nox -s matrix:python)" >> $GITHUB_OUTPUT
27+
echo "matrix=$(poetry run -- nox -s matrix:python)" >> $GITHUB_OUTPUT
2828
2929
outputs:
3030
matrix: ${{ steps.set-matrix.outputs.matrix }}

.github/workflows/report.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727
- name: Copy Artifacts into Root Folder
2828
working-directory: ./artifacts
2929
run: |
30-
poetry run coverage combine --keep coverage-python3.9*/.coverage
30+
poetry run -- coverage combine --keep coverage-python3.9*/.coverage
3131
# Errors during copying are ignored because they are checked in the next step
3232
cp .coverage ../ || true
3333
cp lint-python3.9/.lint.txt ../ || true
3434
cp lint-python3.9/.lint.json ../ || true
3535
cp security-python3.9/.security.json ../ || true
3636
3737
- name: Validate Artifacts
38-
run: poetry run nox -s artifacts:validate
38+
run: poetry run -- nox -s artifacts:validate
3939

4040
- name: Generate Report
41-
run: poetry run nox -s project:report -- -- --format json | tee metrics.json
41+
run: poetry run -- nox -s project:report -- --format json | tee metrics.json
4242

4343
- name: Upload Artifacts
4444
uses: actions/upload-artifact@v4.6.0
@@ -49,9 +49,9 @@ jobs:
4949
- name: Generate GitHub Summary
5050
run: |
5151
echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY
52-
poetry run nox -s project:report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
53-
poetry run nox -s dependency:licenses >> $GITHUB_STEP_SUMMARY
52+
poetry run -- nox -s project:report -- --format markdown >> $GITHUB_STEP_SUMMARY
53+
poetry run -- nox -s dependency:licenses >> $GITHUB_STEP_SUMMARY
5454
echo -e "\n\n# Coverage\n" >> $GITHUB_STEP_SUMMARY
5555
poetry run coverage report -- --format markdown >> $GITHUB_STEP_SUMMARY
56-
poetry run tbx lint pretty-print >> $GITHUB_STEP_SUMMARY
57-
poetry run tbx security pretty-print .security.json >> $GITHUB_STEP_SUMMARY
56+
poetry run -- tbx lint pretty-print >> $GITHUB_STEP_SUMMARY
57+
poetry run -- tbx security pretty-print .security.json >> $GITHUB_STEP_SUMMARY

.github/workflows/slow-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python-version: ${{ matrix.python-version }}
3434

3535
- name: Run Tests and Collect Coverage
36-
run: poetry run nox -s test:integration -- -- --coverage --db-version ${{ matrix.exasol-version }}
36+
run: poetry run -- nox -s test:integration -- --coverage --db-version ${{ matrix.exasol-version }}
3737

3838
- name: Upload Artifacts
3939
uses: actions/upload-artifact@v4.6.0

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
types: [ python ]
99
pass_filenames: false
1010
language: system
11-
entry: poetry run nox -s project:fix
11+
entry: poetry run -- nox -s project:fix
1212
stages: [ pre-commit ]
1313

1414
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -28,7 +28,7 @@ repos:
2828
types: [ python ]
2929
pass_filenames: false
3030
language: system
31-
entry: poetry run nox -s lint:typing
31+
entry: poetry run -- nox -s lint:typing
3232
stages: [ pre-push ]
3333

3434
- repo: local
@@ -38,5 +38,5 @@ repos:
3838
types: [ python ]
3939
pass_filenames: false
4040
language: system
41-
entry: poetry run nox -s lint:code
41+
entry: poetry run -- nox -s lint:code
4242
stages: [ pre-push ]

doc/changes/unreleased.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Unreleased
22

3+
## Summary
4+
5+
In exasol-toolbox version `1.0.0` and higher the default behavior for
6+
`.github/actions/python-environment/action.yml` has changed. In previous versions,
7+
the default value for `poetry-version` was `1.2.2`, and it is now `2.1.2`.
8+
9+
* Depending on its poetry version, a repository relying on the default behavior of said
10+
action may run into breaking changes. This can easily be resolved with explicitly setting the
11+
`poetry-version` when calling the GitHub action. It is, however, recommended whenever
12+
possible to update the poetry version of affected repository to `2.x`.
13+
314
## ✨ Features
415

516
* [#73](https://github.com/exasol/python-toolbox/issues/73): Added nox target for auditing work spaces in regard to known vulnerabilities
@@ -8,4 +19,5 @@
819
* [#372](https://github.com/exasol/python-toolbox/issues/372): Added conversion from pip-audit JSON to expected GitHub Issue format
920

1021
## ⚒️ Refactorings
11-
* [#388](https://github.com/exasol/python-toolbox/issues/388): Switch GitHub workflows to use pinned OS version
22+
* [#388](https://github.com/exasol/python-toolbox/issues/388): Switched GitHub workflows to use pinned OS version
23+
* [#376](https://github.com/exasol/python-toolbox/issues/376): Updated to poetry `2.1.2`

0 commit comments

Comments
 (0)