8000 Move mypy version upper bound to a [compatible-mypy] extra (#979) · typeddjango/django-stubs@24a3b22 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24a3b22

Browse files
andersksobolevn
andauthored
Move mypy version upper bound to a [compatible-mypy] extra (#979)
* Move mypy version upper bound to a [compatible-mypy] extra Due to a bug in mypy 0.940 (#870), we made two changes in #871: • pinned mypy==0.931 in requirements.txt (for running our tests); • bounded mypy<0.940 in setup.py (for downstream users). After the mypy bug was quickly fixed upstream in 0.941, our setup.py bound has been repeatedly raised but not removed (#886, #939, #973). The only changes in those commits have been to the precise wording of error messages expected in our tests. Those wording changes don’t impact compatibility for downstream users, so it should be safe to go back to allowing them to upgrade mypy independently. Since mypy doesn’t yet guarantee backwards compatibility in the plugin API (although in practice it has rarely been an issue), add a django-stubs[compatible-mypy] extra for users who prefer a known-good version of mypy even if it’s a little out of date. Signed-off-by: Anders Kaseorg <andersk@mit.edu> * Update setup.py Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent 43b0828 commit 24a3b22

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This package contains [type stubs](https://www.python.org/dev/peps/pep-0561/) an
1414
## Installation
1515

1616
```bash
17-
pip install django-stubs
17+
pip install django-stubs[compatible-mypy]
1818
```
1919

2020
To make mypy aware of the plugin, you need to add

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pytest==7.1.2
77
pytest-mypy-plugins==1.9.3
88
psycopg2-binary
99
-e ./django_stubs_ext
10-
-e .
10+
-e .[compatible-mypy]
1111

1212
# Overrides:
1313
mypy==0.960

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def find_stub_files(name: str) -> List[str]:
2020
readme = f.read()
2121

2222
dependencies = [
23-
"mypy>=0.930,<0.970",
23+
"mypy>=0.930",
2424
"django",
2525
"django-stubs-ext>=0.4.0",
2626
"tomli",
@@ -30,6 +30,10 @@ def find_stub_files(name: str) -> List[str]:
3030
"types-PyYAML",
3131
]
3232

33+
extras_require = {
34+
"compatible-mypy": ["mypy>=0.930,<0.970"],
35+
}
36+
3337
setup(
3438
name="django-stubs",
3539
version="1.11.1",
@@ -43,6 +47,7 @@ def find_stub_files(name: str) -> List[str]:
4347
py_modules=[],
4448
python_requires=">=3.7",
4549
install_requires=dependencies,
50+
extras_require=extras_require,
4651
packages=["django-stubs", *find_packages(exclude=["scripts"])],
4752
package_data={
4853
"django-stubs": find_stub_files("django-stubs"),

0 commit comments

Comments
 (0)
0