Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.

Commit d0dd312

Browse files
authored
Merge pull request #255 from snok/sondrelg/fixes
Update version to v2
2 parents 6a72ade + 61e03b2 commit d0dd312

File tree

5 files changed

+106
-89
lines changed

5 files changed

+106
-89
lines changed

.codecov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs: https://docs.codecov.io/docs/codecovyml-reference
22

33
codecov:
4-
require_ci_to_pass: yes
4+
require_ci_to_pass: true
55

66
coverage:
77
precision: 1
@@ -10,9 +10,9 @@ coverage:
1010
project:
1111
default:
1212
target: auto
13-
patch: no
14-
changes: no
13+
patch: false
14+
changes: false
1515

1616
comment:
1717
layout: "diff,files"
18-
require_changes: yes
18+
require_changes: true

.github/workflows/testing.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ jobs:
2020
path: .venv
2121
key: venv-0 # increment to reset
2222
- run: |
23-
pip install virtualenv
24-
virtualenv .venv
23+
python -m venv .venv --upgrade-deps
2524
source .venv/bin/activate
2625
pip install pre-commit
2726
if: steps.cache-venv.outputs.cache-hit != 'true'
2827
- uses: actions/cache@v2
2928
id: pre-commit-cache
3029
with:
3130
path: ~/.cache/pre-commit
32-
key: key-0
31+
key: key-0 # increment to reset
3332
- run: |
3433
source .venv/bin/activate
3534
pre-commit run --all-files
@@ -55,8 +54,7 @@ jobs:
5554
with:
5655
path: ~/.local
5756
key: key-3
58-
- name: Install poetry
59-
uses: snok/install-poetry@v1
57+
- uses: snok/install-poetry@v1
6058
with:
6159
virtualenvs-create: false
6260
- uses: actions/cache@v2
@@ -65,33 +63,31 @@ jobs:
6563
path: .venv
6664
key: ${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-2
6765
- run: |
68-
pip install virtualenv
69-
virtualenv .venv
66+
python -m venv .venv
7067
source .venv/bin/activate
71-
pip install pip setuptools wheel -U
68+
pip install wheel setuptools pip -U
7269
poetry install --no-interaction --no-root
7370
if: steps.cache-venv.outputs.cache-hit != 'true'
74-
- name: Install django version
75-
run: |
71+
- run: |
7672
source .venv/bin/activate
7773
pip install "Django==${{ matrix.django-version }}"
78-
- name: Run tests
79-
run: |
74+
- run: |
8075
source .venv/bin/activate
81-
pytest --cov=. --cov-report xml --cov-report term-missing
82-
- name: Archive coverage
83-
uses: actions/upload-artifact@v2
76+
coverage run -m pytest
77+
coverage xml
78+
coverage report
79+
- uses: actions/upload-artifact@v2
8480
with:
8581
name: coverage-xml
8682
path: coverage.xml
8783
if: matrix.python-version == '3.10' && matrix.django-version == '4.0'
84+
8885
coverage:
8986
needs: test
9087
runs-on: ubuntu-latest
9188
steps:
9289
- uses: actions/checkout@v2
93-
- name: Get coverage
94-
uses: actions/download-artifact@v2
90+
- uses: actions/download-artifact@v2
9591
with:
9692
name: coverage-xml
9793
- uses: codecov/codecov-action@v2
@@ -101,7 +97,8 @@ jobs:
10197
token: ${{ secrets.CODECOV_TOKEN }}
10298
- name: Fix coverage file for sonarcloud
10399
run: |
104-
sed -i "s/<source>\/home\/runner\/work\/drf-openapi-tester\//<source>/g" coverage.xml
100+
sed -i "s/<source>\/home\/runner\/work\/drf-openapi-tester\/drf-openapi-tester\//<source>/g" coverage.xml
101+
cat coverage.xml
105102
- uses: sonarsource/sonarcloud-github-action@master
106103
env:
107104
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ repos:
33
rev: 21.12b0
44
hooks:
55
- id: black
6-
args: ['--quiet']
6+
args: [ '--quiet' ]
7+
78
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.0.1
9+
rev: v4.1.0
910
hooks:
1011
- id: check-case-conflict
1112
- id: end-of-file-fixer
@@ -14,6 +15,7 @@ repos:
1415
- id: check-json
1516
- id: check-yaml
1617
- id: check-merge-conflict
18+
1719
- repo: https://gitlab.com/pycqa/flake8
1820
rev: 3.9.2
1921
hooks:
@@ -28,20 +30,30 @@ repos:
2830
'flake8-pytest-style',
2931
'flake8-type-checking',
3032
]
33+
3134
- repo: https://github.com/asottile/pyupgrade
32-
rev: v2.29.1
35+
rev: v2.30.0
3336
hooks:
3437
- id: pyupgrade
35-
args: ["--py36-plus", "--py37-plus"]
38+
args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]
39+
3640
- repo: https://github.com/pycqa/isort
3741
rev: 5.10.1
3842
hooks:
3943
- id: isort
44+
4045
- repo: https://github.com/pre-commit/mirrors-mypy
41-
rev: 'v0.920'
46+
rev: 'v0.930'
4247
hooks:
4348
- id: mypy
44-
additional_dependencies: [django, djangorestframework, inflection, openapi-spec-validator, prance, pyYAML, django-stubs, djangorestframework-stubs, drf_yasg, drf-spectacular, types-PyYAML]
49+
additional_dependencies:
50+
- django-stubs
51+
- djangorestframework
52+
- djangorestframework-stubs
53+
- types-PyYAML
54+
- drf-yasg
55+
- drf-spectacular
56+
4557
- repo: local
4658
hooks:
4759
- id: pylint
@@ -50,4 +62,16 @@ repos:
5062
language: python
5163
types: [ python ]
5264
exclude: tests|test_project|manage.py
53-
additional_dependencies: [django, djangorestframework, inflection, openapi-spec-validator, prance, pyYAML, django-stubs, djangorestframework-stubs, drf_yasg, drf-spectacular, pylint, faker]
65+
additional_dependencies:
66+
- django
67+
- djangorestframework
68+
- inflection
69+
- openapi-spec-validator
70+
- prance
71+
- pyYAML
72+
- django-stubs
73+
- djangorestframework-stubs
74+
- drf_yasg
75+
- drf-spectacular
76+
- pylint
77+
- faker

0 commit comments

Comments
 (0)