Skip to content

Commit 228f0e8

Browse files
authored
fix ci (lovasoa#185)
* Update dev dependencies * mypy has gotten smarter, and it tries to do an automatic cast that breaks our code * drop support for pre-commit hooks on 3.6 * downgrade types-dataclass
1 parent db73714 commit 228f0e8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
python -m pip install --upgrade pip
3232
pip install --pre -e '.[dev]'
3333
- name: Pre-commit hooks
34-
if: ${{ matrix.python_version != 'pypy3' }}
34+
if: ${{ matrix.python_version != 'pypy3' && matrix.python_version != '3.6' }}
3535
run: pre-commit run --all-files
3636
- name: Test with pytest
3737
run: pytest

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.7.4
3+
rev: v2.31.0 # Later versions do not support python 3.6
44
hooks:
55
- id: pyupgrade
66
args: ["--py36-plus"]
77
- repo: https://github.com/python/black
8-
rev: 20.8b1
8+
rev: 22.3.0
99
hooks:
1010
- id: black
1111
language_version: python3
1212
- repo: https://gitlab.com/pycqa/flake8
13-
rev: 3.8.4
13+
rev: 3.9.2
1414
hooks:
1515
- id: flake8
1616
additional_dependencies: ['flake8-bugbear==19.8.0']
1717
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: v0.790
18+
rev: v0.931 # Later versions do not support python 3.6
1919
hooks:
2020
- id: mypy
2121
additional_dependencies: [marshmallow-enum,typeguard,marshmallow]
2222
args: [--show-error-codes]
2323
- repo: https://github.com/asottile/blacken-docs
24-
rev: v1.9.1
24+
rev: v1.12.0 # Later versions do not support python 3.6
2525
hooks:
2626
- id: blacken-docs
2727
additional_dependencies: [black==19.3b0]

marshmallow_dataclass/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ def field_for_schema(
597597

598598
# typing.NewType returns a function (in python <= 3.9) or a class (python >= 3.10) with a
599599
# __supertype__ attribute
600-
if typing_inspect.is_new_type(typ):
601-
newtype_supertype = getattr(typ, "__supertype__", None)
600+
newtype_supertype = getattr(typ, "__supertype__", None)
601+
if typing_inspect.is_new_type(typ) and newtype_supertype is not None:
602602
return _field_by_supertype(
603603
typ=typ,
604604
default=default,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
EXTRAS_REQUIRE = {
1919
"enum": ["marshmallow-enum"],
2020
"union": ["typeguard"],
21+
"lint": ["pre-commit~=2.17"],
2122
':python_version == "3.6"': ["dataclasses", "types-dataclasses<0.6.4"],
22-
"lint": ["pre-commit~=1.18"],
2323
"docs": ["sphinx"],
2424
"tests": [
2525
"pytest>=5.4",

0 commit comments

Comments
 (0)