Skip to content

Commit 817da39

Browse files
authored
[Python] Restore required dev dependency + Adjust generated Github workflow (#19773)
* Restore required python client dev dependency pytest-cov * Harmonize python client workflow definitions --------- Co-authored-by: Pascal Bachor <bachorp@users.noreply.github.com>
1 parent 67942aa commit 817da39

File tree

15 files changed

+50
-75
lines changed

15 files changed

+50
-75
lines changed

modules/openapi-generator/src/main/resources/python/github-workflow.mustache

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,8 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install flake8 pytest
29-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30-
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
31-
- name: Lint with flake8
32-
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
28+
pip install -r requirements.txt
29+
pip install -r test-requirements.txt
3730
- name: Test with pytest
3831
run: |
39-
pytest
32+
pytest --cov={{packageName}}

modules/openapi-generator/src/main/resources/python/pyproject.mustache

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ pydantic = ">= 2"
2929
typing-extensions = ">= 4.7.1"
3030

3131
[tool.poetry.dev-dependencies]
32-
pytest = ">=7.2.1"
33-
tox = ">=3.9.0"
34-
flake8 = ">=4.0.0"
35-
types-python-dateutil = ">=2.8.19.14"
36-
mypy = ">=1.5"
32+
pytest = ">= 7.2.1"
33+
pytest-cov = ">= 2.8.1"
34+
tox = ">= 3.9.0"
35+
flake8 = ">= 4.0.0"
36+
types-python-dateutil = ">= 2.8.19.14"
37+
mypy = ">= 1.5"
3738

3839

3940
[build-system]

modules/openapi-generator/src/main/resources/python/test-requirements.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pytest >= 7.2.1
2+
pytest-cov >= 2.8.1
23
tox >= 3.9.0
34
flake8 >= 4.0.0
45
types-python-dateutil >= 2.8.19.14

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.github/workflows/python.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install flake8 pytest
28-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29-
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
30-
- name: Lint with flake8
31-
run: |
32-
# stop the build if there are Python syntax errors or undefined names
33-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
27+
pip install -r requirements.txt
28+
pip install -r test-requirements.txt
3629
- name: Test with pytest
3730
run: |
38-
pytest
31+
pytest --cov={{packageName}}

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ pydantic = ">= 2"
1818
typing-extensions = ">= 4.7.1"
1919

2020
[tool.poetry.dev-dependencies]
21-
pytest = ">=7.2.1"
22-
tox = ">=3.9.0"
23-
flake8 = ">=4.0.0"
24-
types-python-dateutil = ">=2.8.19.14"
25-
mypy = ">=1.5"
21+
pytest = ">= 7.2.1"
22+
pytest-cov = ">= 2.8.1"
23+
tox = ">= 3.9.0"
24+
flake8 = ">= 4.0.0"
25+
types-python-dateutil = ">= 2.8.19.14"
26+
mypy = ">= 1.5"
2627

2728

2829
[build-system]

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pytest >= 7.2.1
2+
pytest-cov >= 2.8.1
23
tox >= 3.9.0
34
flake8 >= 4.0.0
45
types-python-dateutil >= 2.8.19.14

samples/client/echo_api/python/.github/workflows/python.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install flake8 pytest
28-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29-
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
30-
- name: Lint with flake8
31-
run: |
32-
# stop the build if there are Python syntax errors or undefined names
33-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
27+
pip install -r requirements.txt
28+
pip install -r test-requirements.txt
3629
- name: Test with pytest
3730
run: |
38-
pytest
31+
pytest --cov={{packageName}}

samples/client/echo_api/python/pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ pydantic = ">= 2"
1818
typing-extensions = ">= 4.7.1"
1919

2020
[tool.poetry.dev-dependencies]
21-
pytest = ">=7.2.1"
22-
tox = ">=3.9.0"
23-
flake8 = ">=4.0.0"
24-
types-python-dateutil = ">=2.8.19.14"
25-
mypy = ">=1.5"
21+
pytest = ">= 7.2.1"
22+
pytest-cov = ">= 2.8.1"
23+
tox = ">= 3.9.0"
24+
flake8 = ">= 4.0.0"
25+
types-python-dateutil = ">= 2.8.19.14"
26+
mypy = ">= 1.5"
2627

2728

2829
[build-system]

samples/client/echo_api/python/test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pytest >= 7.2.1
2+
pytest-cov >= 2.8.1
23
tox >= 3.9.0
34
flake8 >= 4.0.0
45
types-python-dateutil >= 2.8.19.14

samples/openapi3/client/petstore/python-aiohttp/.github/workflows/python.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install flake8 pytest
28-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29-
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
30-
- name: Lint with flake8
31-
run: |
32-
# stop the build if there are Python syntax errors or undefined names
33-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
27+
pip install -r requirements.txt
28+
pip install -r test-requirements.txt
3629
- name: Test with pytest
3730
run: |
38-
pytest
31+
pytest --cov={{packageName}}

0 commit comments

Comments
 (0)