Skip to content

Commit f9b878e

Browse files
marceljkFyusel
andauthored
fix(python): linter throws errors in new poetry version (#149)
* fix(python): set max version for black linter in pyproject.toml * fix: exclude generated code for linter --------- Co-authored-by: Alexander Dahmen <[email protected]>
1 parent 3751d40 commit f9b878e

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
- name: Install sdk
106106
working-directory: ./sdk-repo-updated
107107
run: |
108-
pip install poetry==1.8.5
108+
pip install poetry
109109
poetry config virtualenvs.create false
110110
python -m venv .venv
111111
. .venv/bin/activate

.github/workflows/sdk-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
python -m venv .venv
7575
. .venv/bin/activate
7676
python -m pip install --upgrade pip
77-
pip install poetry==1.8.5
77+
pip install poetry
7878
poetry config virtualenvs.create false
7979
(cd ./sdk-repo-updated && make install-dev)
8080
scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" "[email protected]:stackitcloud/stackit-sdk-python.git" "python"

templates/python/pyproject.mustache

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,5 @@ inline-quotes = '"'
9595
docstring-quotes = '"""'
9696
multiline-quotes = '"""'
9797
ban-relative-imports = true
98-
per-file-ignores = """
99-
# asserts are fine in tests, tests shouldn't be build optimized
100-
./tests/*: S101,
101-
# F841: some variables get generated but may not be used, depending on the api-spec
102-
# E501: long descriptions/string values might lead to lines that are too long
103-
./src/stackit/*/models/*: F841,E501
104-
# F841: some variables get generated but may not be used, depending on the api-spec
105-
# E501: long descriptions/string values might lead to lines that are too long
106-
# B028: stacklevel for deprecation warning is irrelevant
107-
./src/stackit/*/api/default_api.py: F841,B028,E501
108-
"""
98+
# Exclude generated code
99+
extend-exclude = [ "src/stackit/*/models/*", "src/stackit/*/api/*", "src/stackit/*/*.py" ]

0 commit comments

Comments
 (0)