Skip to content

Commit 6c0ddf4

Browse files
committed
update pep484 tests
staticmethod can now be type-qualified, so static checkers are complaining. however we don't want to do that here because it's going to fail in Python 3.7. just use an ignore type for the one place we do this right now. Add pep484 tox target as we are getting jenkins to target this for all projects. Change-Id: Ic4db0fc7dd0bfe01308027c911f4dcb288bb169e
1 parent fa0fa49 commit 6c0ddf4

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

dogpile/cache/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ class CacheBackend:
152152
153153
"""
154154

155-
serializer: Union[None, Serializer, staticmethod] = None
155+
serializer: Union[None, Serializer] = None
156156
"""Serializer function that will be used by default if not overridden
157157
by the region.
158158
159159
.. versionadded:: 1.1
160160
161161
"""
162162

163-
deserializer: Union[None, Deserializer, staticmethod] = None
163+
deserializer: Union[None, Deserializer] = None
164164
"""deserializer function that will be used by default if not overridden
165165
by the region.
166166
@@ -446,10 +446,10 @@ def delete_multi(
446446

447447

448448
class DefaultSerialization:
449-
serializer: Union[None, Serializer, staticmethod] = staticmethod(
449+
serializer: Union[None, Serializer] = staticmethod( # type: ignore
450450
pickle.dumps
451451
)
452-
deserializer: Union[None, Deserializer, staticmethod] = staticmethod(
452+
deserializer: Union[None, Deserializer] = staticmethod( # type: ignore
453453
pickle.loads
454454
)
455455

tox.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ commands=
5151
sitepackages=False
5252
usedevelop=True
5353

54-
[testenv:mypy]
54+
55+
[testenv:pep484]
5556
basepython = python3
5657
deps=
5758
mypy
@@ -64,6 +65,13 @@ deps=
6465
types-decorator
6566
commands = mypy ./dogpile/
6667

68+
[testenv:mypy]
69+
basepython = python3
70+
deps=
71+
{[testenv:pep484]deps}
72+
commands = mypy ./dogpile/
73+
74+
6775
# thanks to https://julien.danjou.info/the-best-flake8-extensions/
6876
[testenv:pep8]
6977
basepython = python3

0 commit comments

Comments
 (0)