Skip to content

Commit

Permalink
Pin to jsonschema<4 and update config for testing on recent Python ve…
Browse files Browse the repository at this point in the history
…rsions
  • Loading branch information
terencehonles committed Oct 19, 2021
1 parent 382db87 commit e6a31dd
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '{build}'
image: Visual Studio 2017
image: Visual Studio 2019

environment:
matrix:
Expand All @@ -10,6 +10,10 @@ environment:
TOXENV: py36
- PYTHON: C:\Python37-x64
TOXENV: py37
- PYTHON: C:\Python38-x64
TOXENV: py38
- PYTHON: C:\Python39-x64
TOXENV: py39

build: off

Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@
name: build
on: push
jobs:
pytest:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
python-version:
- '2.7'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install tox
- run: |
tox -e py$(tr -d "." <<<"${{ matrix.python-version }}")
tox:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
tox:
- py27
- py36
- py37
- pre-commit
- mypy
- docs
Expand All @@ -19,6 +37,6 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.9'
- run: pip install tox
- run: tox -e ${{ matrix.tox }}
4 changes: 2 additions & 2 deletions bravado_core/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def wrapper(value):
return value
return func(value)

return wrapper
return wrapper # type: ignore

return external_wrapper

Expand Down Expand Up @@ -82,4 +82,4 @@ def wrapper(*args, **kwargs):
except RecursiveCallException:
return lambda *new_args, **new_kawrgs: func(*args, **kwargs)(*new_args, **new_kawrgs)

return wrapper
return wrapper # type: ignore
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ warn_redundant_casts = True
disallow_untyped_calls = True
check_untyped_defs = True
disallow_untyped_defs = True
pretty = True
show_error_codes = True
show_error_context = True

# # This is needed to allow gradual typing of the library
# # Remove the exceptions defined below once the module is completely typed
Expand Down
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Unit test dependencies
mock
mypy-extensions; python_version>='3.5'
mypy; python_version>='3.5'
pre-commit
pytest
pytest-benchmark[histogram]
pytest-cov
pytest<4.7 # need support for Python 2.7, see https://docs.pytest.org/en/latest/py27-py34-deprecation.html
14 changes: 14 additions & 0 deletions requirements-typing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# mypy dependencies
mypy-extensions
mypy[python2]
# Restrict pytest to a version which does not publish types which are
# in Python3 format and will break on Python2.
pytest<6
types-enum34
# Restrict types-mock to a version which supports Python2
types-mock==0.1.5
types-python-dateutil
types-pytz
types-PyYAML
types-simplejson
types-six
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

install_requires = [
"jsonref",
"jsonschema[format]>=2.5.1",
"jsonschema[format]>=2.5.1,<4.0.0",
"python-dateutil",
"pyyaml",
"simplejson",
Expand Down Expand Up @@ -49,6 +49,9 @@
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
install_requires=install_requires,
package_data={
Expand Down
11 changes: 7 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ filterwarnings =
ignore:.*will be deprecated in the next major release. Please use the more general entry-point offered in.*:DeprecationWarning

[tox]
envlist = py27, py36, py37, mypy, pre-commit
envlist = py27, py3{6,7,8,9,10}, mypy, pre-commit

[testenv]
deps =
Expand All @@ -12,7 +12,7 @@ commands =
python -m pytest --cov --capture=no --benchmark-skip {posargs:tests}

[testenv:benchmark]
basepython = python3.7
basepython = python3.9
deps =
-rrequirements-dev.txt
commands =
Expand All @@ -23,9 +23,12 @@ commands =
--benchmark-histogram=.benchmarks/benchmark

[testenv:mypy]
basepython = python3.7
basepython = python3.9
deps =
-rrequirements-dev.txt
-rrequirements-typing.txt
commands =
mypy bravado_core tests
mypy bravado_core tests {posargs}

[testenv:docs]
deps =
Expand Down

0 comments on commit e6a31dd

Please sign in to comment.