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

Commit 0bb6fa0

Browse files
authored
Merge pull request #234 from snok/sondrelg/codecov
Replace codecov workflow
2 parents 389d4f3 + 697d7ab commit 0bb6fa0

File tree

5 files changed

+243
-180
lines changed

5 files changed

+243
-180
lines changed

.github/workflows/codecov.yml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,10 @@ on:
88

99
jobs:
1010
codecov:
11-
# ---------------------------------------------------
12-
# Documentation and examples can be found at
13-
# https://github.com/snok/install-poetry
14-
# ---------------------------------------------------
1511
runs-on: ubuntu-latest
1612
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-python@v2
19-
with:
20-
python-version: 3.9
21-
- name: Install poetry
22-
uses: snok/install-poetry@v1.1.1
23-
with:
24-
virtualenvs-create: true
25-
virtualenvs-in-project: true
26-
- uses: actions/cache@v2
27-
id: cache-venv
28-
with:
29-
path: .venv
30-
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-3
31-
- run: poetry install --no-interaction --no-root
32-
if: steps.cache-venv.outputs.cache-hit != 'true'
33-
- run: poetry install --no-interaction
34-
- run: poetry run pytest --cov=openapi_tester --cov-report=xml
35-
- uses: codecov/codecov-action@v1
36-
with:
37-
file: ./coverage.xml
38-
fail_ci_if_error: true
13+
- uses: snok/.github/workflows/codecov@main
14+
with:
15+
source-dir: openapi_tester
16+
pip-cache-key: pip-0
17+
poetry-cache-key: poetry-0

.github/workflows/testing.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10.0-beta.1" ]
34+
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10.0-rc.1" ]
3535
django-version: [ "2.2", "3.0", "3.1", "3.2" ]
3636
steps:
3737
- name: Check out repository
@@ -41,16 +41,16 @@ jobs:
4141
with:
4242
python-version: ${{ matrix.python-version }}
4343
- name: Install poetry
44-
uses: snok/install-poetry@v1.1.6
44+
uses: snok/install-poetry@v1
4545
with:
46-
version: 1.2.0a1
46+
version: 1.2.0a2
4747
virtualenvs-in-project: true
4848
- name: Load cached venv
4949
uses: actions/cache@v2
5050
id: cache-venv
5151
with:
5252
path: .venv
53-
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-3
53+
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-4
5454
- name: Install dependencies
5555
run: poetry install --no-interaction --no-root
5656
if: steps.cache-venv.outputs.cache-hit != 'true'

.pre-commit-config.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
repos:
2-
- repo: https://github.com/ambv/black
3-
rev: 21.5b1
2+
- repo: https://github.com/psf/black
3+
rev: 21.7b0
44
hooks:
55
- id: black
6-
args: ["--quiet"]
6+
args: ['--quiet']
77
- repo: https://github.com/pre-commit/pre-commit-hooks
88
rev: v4.0.1
99
hooks:
@@ -28,23 +28,19 @@ repos:
2828
'flake8-pytest-style',
2929
]
3030
- repo: https://github.com/asottile/pyupgrade
31-
rev: v2.17.0
31+
rev: v2.24.0
3232
hooks:
3333
- id: pyupgrade
3434
args: ["--py36-plus"]
35-
- repo: https://github.com/asottile/seed-isort-config
36-
rev: v2.2.0
37-
hooks:
38-
- id: seed-isort-config
3935
- repo: https://github.com/pycqa/isort
40-
rev: 5.8.0
36+
rev: 5.9.3
4137
hooks:
4238
- id: isort
4339
- repo: https://github.com/pre-commit/mirrors-mypy
44-
rev: 'v0.812'
40+
rev: 'v0.910'
4541
hooks:
4642
- id: mypy
47-
additional_dependencies: [django, djangorestframework, inflection, openapi-spec-validator, prance, pyYAML, django-stubs, djangorestframework-stubs, drf_yasg, drf-spectacular]
43+
additional_dependencies: [django, djangorestframework, inflection, openapi-spec-validator, prance, pyYAML, django-stubs, djangorestframework-stubs, drf_yasg, drf-spectacular, types-PyYAML]
4844
- repo: local
4945
hooks:
5046
- id: pylint

openapi_tester/loaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,6 @@ def load_schema(self) -> dict:
231231
:return: Schema contents as a dict
232232
:raises: ImproperlyConfigured
233233
"""
234-
with open(self.path) as file:
234+
with open(self.path, encoding="utf-8") as file:
235235
content = file.read()
236236
return json.loads(content) if ".json" in self.path else yaml.load(content, Loader=yaml.FullLoader)

0 commit comments

Comments
 (0)