Re-organize directory structure (#4971)

See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
Ivan Levkivskyi
2021-01-27 12:00:39 +00:00
committed by GitHub
parent 869238e587
commit 16ae4c6120
1399 changed files with 601 additions and 97 deletions

View File

@@ -0,0 +1,3 @@
version = "0.1"
python2 = true
requires = ["types-typing-extensions"]

View File

@@ -0,0 +1 @@
from .classic import deprecated as deprecated

View File

@@ -0,0 +1,21 @@
from typing import Any, Callable, Optional, Type, TypeVar, overload
_F = TypeVar("_F", bound=Callable[..., Any])
class ClassicAdapter:
reason: str
version: str
action: Optional[str]
category: Type[DeprecationWarning]
def __init__(
self, reason: str = ..., version: str = ..., action: Optional[str] = ..., category: Type[DeprecationWarning] = ...
) -> None: ...
def get_deprecated_msg(self, wrapped: Callable[..., Any], instance: object) -> str: ...
def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ...
@overload
def deprecated(__wrapped: _F) -> _F: ...
@overload
def deprecated(
reason: str = ..., *, version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ...
) -> Callable[[_F], _F]: ...

View File

@@ -0,0 +1,31 @@
from typing import Any, Callable, Optional, Type, TypeVar, overload
from typing_extensions import Literal
from .classic import ClassicAdapter
_F = TypeVar("_F", bound=Callable[..., Any])
class SphinxAdapter(ClassicAdapter):
directive: Literal["versionadded", "versionchanged", "deprecated"]
reason: str
version: str
action: Optional[str]
category: Type[DeprecationWarning]
def __init__(
self,
directive: Literal["versionadded", "versionchanged", "deprecated"],
reason: str = ...,
version: str = ...,
action: Optional[str] = ...,
category: Type[DeprecationWarning] = ...,
) -> None: ...
def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ...
def versionadded(reason: str = ..., version: str = ...) -> Callable[[_F], _F]: ...
def versionchanged(reason: str = ..., version: str = ...) -> Callable[[_F], _F]: ...
@overload
def deprecated(__wrapped: _F) -> _F: ...
@overload
def deprecated(
reason: str = ..., *, version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ...
) -> Callable[[_F], _F]: ...