run black over stubs, add checking to travis

This commit is contained in:
Maxim Kurnikov
2018-12-03 18:52:44 +03:00
parent d5bc7d4ab2
commit cf6119bf9b
420 changed files with 2295 additions and 8384 deletions

View File

@@ -17,13 +17,9 @@ class SessionBase:
def __init__(self, session_key: Optional[str] = ...) -> None: ...
def __contains__(self, key: str) -> bool: ...
def __getitem__(self, key: str) -> Union[Model, int, str]: ...
def __setitem__(
self, key: str, value: Union[datetime, Model, int, str]
) -> None: ...
def __setitem__(self, key: str, value: Union[datetime, Model, int, str]) -> None: ...
def __delitem__(self, key: str) -> None: ...
def get(
self, key: str, default: Optional[str] = ...
) -> Optional[Union[datetime, int, str]]: ...
def get(self, key: str, default: Optional[str] = ...) -> Optional[Union[datetime, int, str]]: ...
def pop(self, key: str, default: Any = ...) -> Union[int, str]: ...
def setdefault(self, key: str, value: str) -> str: ...
def set_test_cookie(self) -> None: ...

View File

@@ -5,7 +5,6 @@ from django.contrib.sessions.base_session import AbstractBaseSession
from django.contrib.sessions.models import Session
from django.db.models.base import Model
class SessionStore(SessionBase):
accessed: bool
serializer: Type[django.core.signing.JSONSerializer]
@@ -17,9 +16,7 @@ class SessionStore(SessionBase):
def exists(self, session_key: Optional[str]) -> bool: ...
modified: bool = ...
def create(self) -> None: ...
def create_model_instance(
self, data: Dict[str, Model]
) -> AbstractBaseSession: ...
def create_model_instance(self, data: Dict[str, Model]) -> AbstractBaseSession: ...
def save(self, must_create: bool = ...) -> None: ...
def delete(self, session_key: Optional[str] = ...) -> None: ...
@classmethod

View File

@@ -2,7 +2,6 @@ from typing import Any, Dict, Optional, Union
from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
accessed: bool
serializer: Type[django.core.signing.JSONSerializer]

View File

@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional, Union
from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
accessed: bool
serializer: Type[django.core.signing.JSONSerializer]

View File

@@ -3,18 +3,12 @@ from typing import Any, Dict, Optional
from django.db import models
class BaseSessionManager(models.Manager):
creation_counter: int
model: None
name: None
def encode(self, session_dict: Dict[str, int]) -> str: ...
def save(
self,
session_key: str,
session_dict: Dict[str, int],
expire_date: datetime,
) -> AbstractBaseSession: ...
def save(self, session_key: str, session_dict: Dict[str, int], expire_date: datetime) -> AbstractBaseSession: ...
class AbstractBaseSession(models.Model):
session_key: Any = ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -6,15 +6,9 @@ from django.http.request import HttpRequest
from django.http.response import HttpResponseBase
from django.utils.deprecation import MiddlewareMixin
class SessionMiddleware(MiddlewareMixin):
get_response: Callable[[WSGIRequest], HttpResponseBase] = ...
SessionStore: Type[SessionBase] = ...
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
def process_request(self, request: HttpRequest) -> None: ...
def process_response(
self, request: WSGIRequest, response: HttpResponseBase
) -> HttpResponseBase: ...
def process_response(self, request: WSGIRequest, response: HttpResponseBase) -> HttpResponseBase: ...

View File

@@ -1,9 +1,7 @@
from typing import Any, Optional, Type
from django.contrib.sessions.backends.db import SessionStore
from django.contrib.sessions.base_session import (AbstractBaseSession,
BaseSessionManager)
from django.contrib.sessions.base_session import AbstractBaseSession, BaseSessionManager
class SessionManager(BaseSessionManager):
creation_counter: int

View File

@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional
from django.core.signing import JSONSerializer as BaseJSONSerializer
from django.db.models.base import Model
class PickleSerializer:
def dumps(self, obj: Dict[str, Model]) -> bytes: ...
def loads(self, data: bytes) -> Dict[str, Model]: ...