File tree Expand file tree Collapse file tree 6 files changed +125
-61
lines changed Expand file tree Collapse file tree 6 files changed +125
-61
lines changed Original file line number Diff line number Diff line change 6060
6161 - name : Upload coverage
6262 uses : codecov/codecov-action@v1
63+
64+ static-checks :
65+ name : " Static checks"
66+ runs-on : ubuntu-latest
67+ steps :
68+ - name : " Checkout ${{ github.ref }} ( ${{ github.sha }} )"
69+ uses : actions/checkout@v2
70+
71+ - name : " Setup Python"
72+ uses : actions/setup-python@v2
73+ with :
74+ python-version : 3.9
75+
76+ - name : Get full Python version
77+ id : full-python-version
78+ run : echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
79+
80+ - name : Bootstrap poetry
81+ run : |
82+ curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y
83+ echo "$HOME/.local/bin" >> $GITHUB_PATH
84+
85+ - name : Configure poetry
86+ run : poetry config virtualenvs.in-project true
87+
88+ - name : Set up cache
89+ uses : actions/cache@v2
90+ id : cache
91+ with :
92+ path : .venv
93+ key : venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
94+
95+ - name : Ensure cache is healthy
96+ if : steps.cache.outputs.cache-hit == 'true'
97+ run : timeout 10s poetry run pip --version || rm -rf .venv
98+
99+ - name : Install dependencies
100+ run : poetry install
101+
102+ - name : Run static checks
103+ run : poetry run pre-commit run -a
Original file line number Diff line number Diff line change 1010 - id : check-hooks-apply
1111
1212 - repo : https://github.com/asottile/pyupgrade
13- rev : v2.19.0
13+ rev : v2.38.4
1414 hooks :
1515 - id : pyupgrade
1616 args : ["--py36-plus"]
Original file line number Diff line number Diff line change 22from openapi_schema_validator ._format import oas31_format_checker
33from openapi_schema_validator .shortcuts import validate
44from openapi_schema_validator .validators import OAS30ReadValidator
5- from openapi_schema_validator .validators import OAS30WriteValidator
65from openapi_schema_validator .validators import OAS30Validator
6+ from openapi_schema_validator .validators import OAS30WriteValidator
77from openapi_schema_validator .validators import OAS31Validator
88
99__author__ = "Artur Maciag"
Original file line number Diff line number Diff line change @@ -187,10 +187,7 @@ def read_required(
187187 prop_schema = schema .get ("properties" , {}).get (property )
188188 if prop_schema :
189189 write_only = prop_schema .get ("writeOnly" , False )
190- if (
191- getattr (validator , "read" , True )
192- and write_only
193- ):
190+ if getattr (validator , "read" , True ) and write_only :
194191 continue
195192 yield ValidationError (f"{ property !r} is a required property" )
196193
Original file line number Diff line number Diff line change 1+ import warnings
12from typing import Any
23from typing import Type
3- import warnings
44
55from jsonschema import _legacy_validators
66from jsonschema import _utils
You can’t perform that action at this time.
0 commit comments