mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38135f2d1f | ||
|
|
998b659749 | ||
|
|
72f69e1c5e | ||
|
|
d666ecd36f | ||
|
|
c1af26c027 |
@@ -1,5 +1,5 @@
|
||||
black
|
||||
pytest-mypy-plugins==1.1.0
|
||||
pytest-mypy-plugins==1.2.0
|
||||
psycopg2
|
||||
flake8==3.7.9
|
||||
flake8-pyi==19.3.0
|
||||
|
||||
@@ -331,9 +331,14 @@ def copy_method_to_another_class(ctx: ClassDefContext, self_type: Instance,
|
||||
semanal_api = get_semanal_api(ctx)
|
||||
for argument in arguments:
|
||||
if argument.type_annotation is not None:
|
||||
argument.type_annotation = semanal_api.anal_type(argument.type_annotation)
|
||||
argument.type_annotation = semanal_api.anal_type(argument.type_annotation,
|
||||
allow_placeholder=True)
|
||||
|
||||
if return_type is not None:
|
||||
return_type = semanal_api.anal_type(return_type) or AnyType(TypeOfAny.unannotated)
|
||||
ret = semanal_api.anal_type(return_type,
|
||||
allow_placeholder=True)
|
||||
assert ret is not None
|
||||
return_type = ret
|
||||
|
||||
add_method(ctx,
|
||||
new_method_name,
|
||||
|
||||
@@ -178,7 +178,6 @@ IGNORED_ERRORS = {
|
||||
],
|
||||
'files': [
|
||||
'Incompatible types in assignment (expression has type "IOBase", variable has type "File")',
|
||||
'Argument 1 to "write" of "SpooledTemporaryFile"',
|
||||
],
|
||||
'filtered_relation': [
|
||||
'has no attribute "name"',
|
||||
@@ -231,13 +230,8 @@ IGNORED_ERRORS = {
|
||||
],
|
||||
'mail': [
|
||||
'List item 1 has incompatible type "None"; expected "str"',
|
||||
'Argument 1 to "push" of "SMTPChannel" has incompatible type "str"; expected "bytes"',
|
||||
'Value of type "Union[List[Message], str, bytes, None]" is not indexable',
|
||||
'Incompatible types in assignment '
|
||||
+ '(expression has type "bool", variable has type "Union[SMTP_SSL, SMTP, None]")',
|
||||
re.compile(
|
||||
r'Item "(int|str)" of "Union\[Message, str, int, Any\]" has no attribute "(get_content_type|get_filename)"'
|
||||
)
|
||||
],
|
||||
'messages_tests': [
|
||||
'List item 0 has incompatible type "Dict[str, Message]"; expected "Message"',
|
||||
@@ -320,9 +314,6 @@ IGNORED_ERRORS = {
|
||||
'model_enums': [
|
||||
"'bool' is not a valid base class",
|
||||
],
|
||||
'multiple_database': [
|
||||
'Unexpected attribute "extra_arg" for model "Book"'
|
||||
],
|
||||
'null_queries': [
|
||||
"Cannot resolve keyword 'foo' into field"
|
||||
],
|
||||
|
||||
4
setup.py
4
setup.py
@@ -21,14 +21,14 @@ with open('README.md', 'r') as f:
|
||||
readme = f.read()
|
||||
|
||||
dependencies = [
|
||||
'mypy>=0.750,<0.760',
|
||||
'mypy>=0.760,<0.770',
|
||||
'typing-extensions',
|
||||
'django',
|
||||
]
|
||||
|
||||
setup(
|
||||
name="django-stubs",
|
||||
version="1.3.3",
|
||||
version="1.4.0",
|
||||
description='Mypy stubs for Django',
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
|
||||
Reference in New Issue
Block a user