-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pin to jsonschema<4 and update config for testing on recent Python versions #385
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }}") | ||
Comment on lines
+19
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will properly install and then test with the right Python versions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small tip: You could install You can see it in use in macisamuele/language-formatters-pre-commit-hooks [1] Actually github actions does support running tests on MacOs and Windows, so it might be nice to centralise testing CI into a single provider (instead of depending on appveyor) |
||
|
||
tox: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tox: | ||
- py27 | ||
- py36 | ||
- py37 | ||
- pre-commit | ||
- mypy | ||
- docs | ||
|
@@ -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 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ def wrapper(value): | |
return value | ||
return func(value) | ||
|
||
return wrapper | ||
return wrapper # type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly the flak8 installed by pre-commit in Python2 does not support specifically ignoring types. This was |
||
|
||
return external_wrapper | ||
|
||
|
@@ -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 |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks for Python 3.10 will automatically be handled by pip for Python 2.7. Mypy however needs |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
install_requires = [ | ||
"jsonref", | ||
"jsonschema[format]>=2.5.1", | ||
"jsonschema[format]>=2.5.1,<4.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original point of this PR 😅 |
||
"python-dateutil", | ||
"pyyaml", | ||
"simplejson", | ||
|
@@ -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={ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.