Skip to content

Commit

Permalink
Version 1.10.0 release (#886)
Browse files Browse the repository at this point in the history
* Version 1.10.0 release

* Fixes CI

* Fixes CI
  • Loading branch information
sobolevn authored Mar 26, 2022
1 parent 3f340c9 commit 3c58270
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We rely on different `django` and `mypy` versions:

| django-stubs | mypy version | django version | python version
| ------------ | ---- | ---- | ---- |
| 1.10.0 | 0.931 | 3.2.x | ^3.7
| 1.10.0 | 0.931+ | 3.2.x | ^3.7
| 1.9.0 | 0.910 | 3.2.x | ^3.6
| 1.8.0 | 0.812 | 3.1.x | ^3.6
| 1.7.0 | 0.790 | 2.2.x \|\| 3.x | ^3.6
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
wheel
black==22.1.0
requests==2.27.1
coreapi==2.3.3
Expand All @@ -9,4 +8,6 @@ pytest-mypy-plugins==1.9.3
psycopg2-binary
-e ./django_stubs_ext
-e .
mypy==0.931

# Overrides:
mypy==0.942
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def find_stub_files(name: str) -> List[str]:
readme = f.read()

dependencies = [
"mypy>=0.930,<0.940",
"mypy>=0.930,<0.950",
"django",
"django-stubs-ext>=0.3.0",
"tomli",
Expand All @@ -33,7 +33,7 @@ def find_stub_files(name: str) -> List[str]:

setup(
name="django-stubs",
version="1.9.0",
version="1.10.0",
description="Mypy stubs for Django",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down
4 changes: 2 additions & 2 deletions tests/typecheck/contrib/admin/test_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
from django.contrib import admin
class A(admin.ModelAdmin):
radio_fields = {"some_field": 0} # E: Dict entry 0 has incompatible type "str": "Literal[0]"; expected "str": "Union[Literal[1], Literal[2]]"
radio_fields = {"some_field": 0} # E: Dict entry 0 has incompatible type "str": "Literal[0]"; expected "str": "Literal[1, 2]"
class B(admin.ModelAdmin):
radio_fields = {1: admin.VERTICAL} # E: Dict entry 0 has incompatible type "int": "Literal[2]"; expected "str": "Union[Literal[1], Literal[2]]"
radio_fields = {1: admin.VERTICAL} # E: Dict entry 0 has incompatible type "int": "Literal[2]"; expected "str": "Literal[1, 2]"
- case: errors_for_invalid_formfield_overrides
main: |
from django.contrib import admin
Expand Down
6 changes: 3 additions & 3 deletions tests/typecheck/managers/querysets/test_annotate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
reveal_type(values_no_params) # N: Revealed type is "builtins.dict*[builtins.str, Any]"
values_list_no_params = Blog.objects.annotate(foo=F('id')).values_list().get()
reveal_type(values_list_no_params) # N: Revealed type is "builtins.tuple*[Any]"
reveal_type(values_list_no_params) # N: Revealed type is "builtins.tuple*[Any, ...]"
values_list_flat_no_params = Blog.objects.annotate(foo=F('id')).values_list(flat=True).get()
reveal_type(values_list_flat_no_params) # N: Revealed type is "builtins.int*"
Expand All @@ -310,7 +310,7 @@
qs1 = Blog.objects.values('text').annotate(foo=F('id'))
reveal_type(qs1) # N: Revealed type is "django.db.models.query._QuerySet[django_stubs_ext.WithAnnotations[myapp__models__Blog, TypedDict({'foo': Any})], builtins.dict[builtins.str, Any]]"
qs2 = Blog.objects.values_list('text').annotate(foo=F('id'))
reveal_type(qs2) # N: Revealed type is "django.db.models.query._QuerySet[django_stubs_ext.WithAnnotations[myapp__models__Blog, TypedDict({'foo': Any})], builtins.tuple[Any]]"
reveal_type(qs2) # N: Revealed type is "django.db.models.query._QuerySet[django_stubs_ext.WithAnnotations[myapp__models__Blog, TypedDict({'foo': Any})], builtins.tuple[Any, ...]]"
qs3 = Blog.objects.values_list('text', named=True).annotate(foo=F('id'))
# TODO: Would be nice to infer a NamedTuple which contains the field 'text' (str) + any number of other fields.
# The reason it would have to appear to have any other fields is that annotate could potentially be called with
Expand All @@ -327,7 +327,7 @@
reveal_type(before_values_no_params) # N: Revealed type is "builtins.dict*[builtins.str, Any]"
before_values_list_no_params = Blog.objects.values_list().annotate(foo=F('id')).get()
reveal_type(before_values_list_no_params) # N: Revealed type is "builtins.tuple*[Any]"
reveal_type(before_values_list_no_params) # N: Revealed type is "builtins.tuple*[Any, ...]"
before_values_list_flat_no_params = Blog.objects.values_list(flat=True).annotate(foo=F('id')).get()
reveal_type(before_values_list_flat_no_params) # N: Revealed type is "builtins.int*"
Expand Down
2 changes: 1 addition & 1 deletion tests/typecheck/managers/querysets/test_basic_methods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
qs = Blog.objects.all()
reveal_type(qs) # N: Revealed type is "django.db.models.query._QuerySet[myapp.models.Blog*, myapp.models.Blog*]"
reveal_type(qs.get(id=1)) # N: Revealed type is "myapp.models.Blog*"
reveal_type(iter(qs)) # N: Revealed type is "typing.Iterator[myapp.models.Blog*]"
reveal_type(iter(qs)) # N: Revealed type is "typing.Iterator*[myapp.models.Blog*]"
reveal_type(qs.iterator()) # N: Revealed type is "typing.Iterator[myapp.models.Blog*]"
reveal_type(qs.first()) # N: Revealed type is "Union[myapp.models.Blog*, None]"
reveal_type(qs.earliest()) # N: Revealed type is "myapp.models.Blog*"
Expand Down
2 changes: 1 addition & 1 deletion tests/typecheck/managers/querysets/test_values_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
reveal_type(query.all().get()) # N: Revealed type is "Tuple[builtins.str]"
reveal_type(query.filter(age__gt=16).get()) # N: Revealed type is "Tuple[builtins.str]"
reveal_type(query.exclude(age__lte=16).get()) # N: Revealed type is "Tuple[builtins.str]"
reveal_type(query.annotate(name_length=Length("name")).get()) # N: Revealed type is "builtins.tuple*[Any]"
reveal_type(query.annotate(name_length=Length("name")).get()) # N: Revealed type is "builtins.tuple*[Any, ...]"
installed_apps:
- myapp
files:
Expand Down

0 comments on commit 3c58270

Please sign in to comment.