Skip to content

Commit b8e865f

Browse files
authored
Update django-stubs, mypy, pytest-mypy-plugins & fix tests (#279)
All these updates have to be done together, otherwise one dependency is incompatible with another in some way that fails in CI.
1 parent 42b0d20 commit b8e865f

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ wheel
22
gitpython==3.1.27
33
pre-commit==2.20.0
44
pytest==7.1.2
5-
pytest-mypy-plugins==1.9.3
5+
pytest-mypy-plugins==1.10.1
66
djangorestframework==3.13.1
77
types-pytz==2022.1.2
8-
django-stubs==1.12.0
9-
django-stubs-ext==0.5.0
8+
django-stubs==1.13.0
9+
django-stubs-ext==0.7.0
1010
-e .[compatible-mypy,coreapi,markdown]

scripts/drf_tests_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SECRET_KEY = "1"
22
SITE_ID = 1
33

4-
INSTALLED_APPS = [
4+
INSTALLED_APPS = (
55
"django.contrib.contenttypes",
66
"django.contrib.sites",
77
"django.contrib.sessions",
@@ -11,4 +11,4 @@
1111
"django.contrib.auth",
1212
"rest_framework",
1313
"rest_framework.authtoken",
14-
]
14+
)

scripts/typecheck_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
'Incompatible types in assignment (expression has type "AsView[GenericView]", variable has type "AsView[Callable[[HttpRequest], Any]]")', # noqa: E501
7777
'Argument "patterns" to "SchemaGenerator" has incompatible type "List[object]"',
7878
'Argument 1 to "field_to_schema" has incompatible type "object"; expected "Field[Any, Any, Any, Any]"',
79+
'Argument "help_text" to "CharField" has incompatible type "_StrPromise"',
7980
],
8081
"browsable_api": [
8182
'(expression has type "List[Dict[str, Dict[str, int]]]", base class "GenericAPIView" defined the type as "Union[QuerySet[_MT?], Manager[_MT?], None]")', # noqa: E501

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ def find_stub_files(name):
1919
readme = f.read()
2020

2121
dependencies = [
22-
"mypy>=0.950",
23-
"django-stubs>=1.11.0",
22+
"mypy>=0.980",
23+
"django-stubs>=1.13.0",
2424
"typing-extensions>=3.10.0",
2525
"requests>=2.0.0",
2626
"types-requests>=0.1.12",
2727
"types-PyYAML>=5.4.3",
2828
]
2929

3030
extras_require = {
31-
"compatible-mypy": ["mypy>=0.950,<0.970"],
31+
"compatible-mypy": ["mypy>=0.980,<0.990"],
3232
"coreapi": ["coreapi>=2.0.0"],
3333
"markdown": ["types-Markdown>=0.1.5"],
3434
}

0 commit comments

Comments
 (0)