diff --git a/.gitignore b/.gitignore index 894a44c..02a6e8e 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,7 @@ venv.bak/ # mypy .mypy_cache/ + +# IDEs +.idea/ +.vscode/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9675eac --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: python +matrix: + include: + - python: 3.7 + dist: xenial + sudo: true + - python: 3.6 + +notifications: + email: false + +install: +- pip install -U -e .[test] + +script: +- flake8 --config=.flake8 cytoolz-stubs + +cache: + directories: + - "$HOME/.cache/pip" diff --git a/cytoolz-stubs/__init__.pyi b/cytoolz-stubs/__init__.pyi new file mode 100644 index 0000000..3d6d889 --- /dev/null +++ b/cytoolz-stubs/__init__.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from .dicttoolz import * +from .functoolz import * +from .itertoolz import * +from .recipes import * + +comp = compose +flip: Any +memoize: Any diff --git a/cytoolz-stubs/_pipe.pyi b/cytoolz-stubs/_pipe.pyi new file mode 100644 index 0000000..30d19b7 --- /dev/null +++ b/cytoolz-stubs/_pipe.pyi @@ -0,0 +1,146 @@ +from typing import Any, Callable, TypeVar, overload + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') +_T7 = TypeVar('_T7') +_T8 = TypeVar('_T8') +_T9 = TypeVar('_T9') +_T10 = TypeVar('_T10') +_T11 = TypeVar('_T11') + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], +) -> _T2: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], +) -> _T3: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], +) -> _T4: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], +) -> _T5: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], + func5: Callable[[_T5], _T6], +) -> _T6: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], + func5: Callable[[_T5], _T6], + func6: Callable[[_T6], _T7], +) -> _T7: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], + func5: Callable[[_T5], _T6], + func6: Callable[[_T6], _T7], + func7: Callable[[_T7], _T8], +) -> _T8: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], + func5: Callable[[_T5], _T6], + func6: Callable[[_T6], _T7], + func7: Callable[[_T7], _T8], + func8: Callable[[_T8], _T9], +) -> _T9: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], + func5: Callable[[_T5], _T6], + func6: Callable[[_T6], _T7], + func7: Callable[[_T7], _T8], + func8: Callable[[_T8], _T9], + func9: Callable[[_T9], _T10], +) -> _T10: + ... + + +@overload +def pipe( + item: _T1, + func1: Callable[[_T1], _T2], + func2: Callable[[_T2], _T3], + func3: Callable[[_T3], _T4], + func4: Callable[[_T4], _T5], + func5: Callable[[_T5], _T6], + func6: Callable[[_T6], _T7], + func7: Callable[[_T7], _T8], + func8: Callable[[_T8], _T9], + func9: Callable[[_T9], _T10], + func10: Callable[[_T10], _T11], +) -> _T11: + ... + + +@overload +def pipe( + item: Any, + *funcs: Callable[[Any], Any], +) -> Any: + ... diff --git a/cytoolz-stubs/curried/__init__.pyi b/cytoolz-stubs/curried/__init__.pyi new file mode 100644 index 0000000..80d3984 --- /dev/null +++ b/cytoolz-stubs/curried/__init__.pyi @@ -0,0 +1,49 @@ +# Stubs for cytoolz.curried (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +from .exceptions import merge, merge_with + +accumulate: Any +assoc: Any +assoc_in: Any +cons: Any +countby: Any +do: Any +drop: Any +excepts: Any +filter: Any +get: Any +get_in: Any +groupby: Any +interpose: Any +itemfilter: Any +itemmap: Any +iterate: Any +join: Any +keyfilter: Any +keymap: Any +map: Any +mapcat: Any +nth: Any +partial: Any +partition: Any +partition_all: Any +partitionby: Any +pluck: Any +random_sample: Any +reduce: Any +reduceby: Any +remove: Any +sliding_window: Any +sorted: Any +tail: Any +take: Any +take_nth: Any +topk: Any +unique: Any +update_in: Any +valfilter: Any +valmap: Any diff --git a/cytoolz-stubs/curried/exceptions.pyi b/cytoolz-stubs/curried/exceptions.pyi new file mode 100644 index 0000000..577e93e --- /dev/null +++ b/cytoolz-stubs/curried/exceptions.pyi @@ -0,0 +1,11 @@ +# Stubs for cytoolz.curried.exceptions (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + + +def merge(d: Any, *dicts: Any, **kwargs: Any) -> Any: ... + + +def merge_with(func: Any, d: Any, *dicts: Any, **kwargs: Any) -> Any: ... diff --git a/cytoolz-stubs/dicttoolz.pyi b/cytoolz-stubs/dicttoolz.pyi new file mode 100644 index 0000000..5b0fc20 --- /dev/null +++ b/cytoolz-stubs/dicttoolz.pyi @@ -0,0 +1,110 @@ +from typing import Any, Callable, Dict, Mapping, Sequence, Tuple, TypeVar, \ + Union, overload + +_K = TypeVar('_K') +_K1 = TypeVar('_K1') +_V = TypeVar('_V') +_V1 = TypeVar('_V1') + + +def assoc( + d: Mapping[_K, _V], + key: _K1, + value: _V1, + factory: Callable[[], Dict[Union[_K, _K1], Union[_V, _V1]]] = dict +) -> Dict[Union[_K, _K1], Union[_V, _V1]]: ... + + +def assoc_in( + d: Mapping[_K, _V], + keys: Sequence[Any], + value: Any, + factory: Callable[[], Dict[_K, Any]] = dict +) -> Dict[_K, Any]: ... + + +def dissoc( + d: Mapping[_K, _V], + *keys: _K, +) -> Dict[_K, _V]: ... + + +def get_in( + keys: Sequence[Any], + coll: Mapping[_K, _V], + default: Any = None, + no_default: bool = False, +) -> Any: ... + + +def itemfilter( + predicate: Callable[[Tuple[_K, _V]], bool], + d: Mapping[_K, _V], + factory: Callable[[], Dict[_K, _V]] = dict, +) -> Dict[_K, _V]: ... + + +def itemmap( + func: Callable[[Tuple[_K, _V]], Tuple[_K1, _V1]], + d: Mapping[_K, _V], + factory: Callable[[], Dict[_K1, _V1]] = dict +) -> Dict[_K1, _V1]: ... + + +def keyfilter( + predicate: Callable[[_K], bool], + d: Mapping[_K, _V], + factory: Callable[[], Dict[_K, _V]] = dict, +) -> Dict[_K, _V]: ... + + +def keymap( + func: Callable[[_K], _K1], + d: Mapping[_K, _V], + factory: Callable[[], Dict[_K1, _V]] = dict +) -> Dict[_K1, _V]: ... + + +def merge( + *dicts: Mapping[_K, _V], + factory: Callable[[], Dict[_K, _V]] = dict, +) -> Dict[_K, _V]: ... + + +@overload +def merge_with( + func: Callable[[Sequence[_V]], _V1], + *dicts: Mapping[_K, _V], + factory: Callable[[], Dict[_K, _V1]] = dict, +) -> Dict[_K, _V1]: ... + + +@overload +def merge_with( + func: Callable[[Sequence[Any]], Any], + *dicts: Mapping[_K, Any], + factory: Callable[[], Dict[_K, Any]] = dict, +) -> Dict[_K, Any]: ... + + +def update_in( + d: Mapping[_K, _V], + keys: Sequence[Any], + func: Callable[[Any], Any], + default: Any = None, + factory: Callable[[], Dict[_K, Any]] = dict, +) -> Dict[_K, Any]: ... + + +def valfilter( + predicate: Callable[[_V], bool], + d: Mapping[_K, _V], + factory: Callable[[], Dict[_K, _V]] = dict, +) -> Dict[_K, _V]: ... + + +def valmap( + func: Callable[[_V], _V1], + d: Mapping[_K, _V], + factory: Callable[[], Dict[_K, _V1]] = dict +) -> Dict[_K, _V1]: ... diff --git a/cytoolz-stubs/functoolz.pyi b/cytoolz-stubs/functoolz.pyi new file mode 100644 index 0000000..3a8b701 --- /dev/null +++ b/cytoolz-stubs/functoolz.pyi @@ -0,0 +1,136 @@ +# Stubs for cytoolz.functoolz (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Callable, Iterator, TypeVar +from ._pipe import * + +_T = TypeVar('_T') +_T1 = TypeVar('_T1') + +compose: Any +dedent: Any + + +def do(func: Callable[[_T], _T1], x: _T) -> _T: ... + + +flip: Any +has_keywords: Any +has_varargs: Any +identity: Any +import_module: Any +inspect: Any +instanceproperty: Any +is_arity: Any +is_partial_args: Any +is_valid_args: Any +juxt: Any +memoize: Any +no_default: str +num_required_args: Any +return_none: Any +thread_first: Any +thread_last: Any + + +def reduce(*args: Any, **kwargs: Any) -> Any: ... + + +class complement: + __reduce__: Any = ... + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + + +class curry: + _has_unknown_args: Any = ... + _should_curry: Any = ... + _should_curry_internal: Any = ... + _sigspec: Any = ... + args: Any = ... + bind: Any = ... + call: Any = ... + func: Any = ... + keywords: Any = ... + __name__: Any = ... + __qualname__: Any = ... + __reduce__: Any = ... + __signature__: Any = ... + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __eq__(self, other: Any) -> Any: ... + + def __ge__(self, other: Any) -> Any: ... + + def __get__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __gt__(self, other: Any) -> Any: ... + + def __hash__(self) -> Any: ... + + def __le__(self, other: Any) -> Any: ... + + def __lt__(self, other: Any) -> Any: ... + + def __ne__(self, other: Any) -> Any: ... + + +class excepts: + exc: Any = ... + func: Any = ... + handler: Any = ... + __name__: Any = ... + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class ifilter: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + +class imap: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + +class partial: + args: Any = ... + func: Any = ... + keywords: Any = ... + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __delattr__(self, name: Any) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setattr__(self, name: Any, value: Any) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... diff --git a/cytoolz-stubs/itertoolz.pyi b/cytoolz-stubs/itertoolz.pyi new file mode 100644 index 0000000..d8a6d49 --- /dev/null +++ b/cytoolz-stubs/itertoolz.pyi @@ -0,0 +1,500 @@ +from random import Random as _Random +from typing import Any, Callable, Dict, Iterable, Iterator, List, Sequence, \ + Tuple, TypeVar, Union, overload + +_K = TypeVar('_K') +_V = TypeVar('_V') +# noinspection PyShadowingBuiltins +_T = TypeVar('_T') +# noinspection PyShadowingBuiltins +_T_co = TypeVar('_T_co', covariant=True) +# noinspection PyShadowingBuiltins +_T1 = TypeVar('_T1') +# noinspection PyShadowingBuiltins +_T2 = TypeVar('_T2') +no_default: str +no_pad: str + + +def concat(seqs: Iterable[Iterable[_T]]) -> Iterable[_T]: ... + + +def concatv(*seqs: Iterable[_T]) -> Iterable[_T]: ... + + +def cons(el: _T, seq: Iterable[_T]) -> Iterator[_T]: ... + + +def count(seq: Iterable) -> int: ... + + +@overload +def diff(*seqs: Sequence[_T]) -> Iterable[Tuple[_T, ...]]: ... + + +@overload +def diff( + *seqs: Sequence[_T], + key: Callable[[_T], _T1], +) -> Iterable[Tuple[_T1, ...]]: ... + + +@overload +def diff( + *seqs: Sequence[_T], + default: _T2, +) -> Iterable[Tuple[Union[_T, _T2], ...]]: ... + + +@overload +def diff( + *seqs: Sequence[_T], + key: Callable[[_T], _T1], + default: _T2, +) -> Iterable[Tuple[Union[_T1, _T2], ...]]: ... + + +def drop(n: int, seq: Iterable[_T]) -> Iterable[_T]: ... + + +def first(seq: Iterable[_T]) -> _T: ... + + +def frequencies(seq: Iterable[_T]) -> Dict[_T, int]: ... + + +@overload +def get(ind: int, seq: Iterable[_T]) -> _T: ... + + +@overload +def get( + ind: int, + seq: Iterable[_T], + default: Union[_T1, str] = no_default, +) -> Union[_T, _T1]: ... + + +# TODO +def getter(index: Any) -> Any: ... + + +@overload +def groupby( + key: _K, + seq: Iterable[Dict[_K, _V]], +) -> Dict[_K, List[Dict[_K, _V]]]: ... + + +@overload +def groupby(key: Callable[[_T], _T1], seq: Iterable[_T]) -> Dict[_T1, List[_T]]: ... + + +def identity(x: _T) -> _T: ... + + +def isdistinct(seq: Iterable) -> bool: ... + + +def isiterable(x: Any) -> bool: ... + + +# TODO +def join(leftkey: Any, leftseq: Any, rightkey: Any, rightseq: Any, + left_default: Any = no_default, + right_default: Any = no_default) -> Any: ... + + +def last(seq: Iterable[_T]) -> _T: ... + + +def mapcat(func: Callable[[_T_co], Iterable[_T1]], + seqs: Iterable[_T_co]) -> Iterable[_T1]: ... + + +# TODO replace kwargs with key +def merge_sorted(*seqs: Iterable[_T], **kwargs: Any) -> Iterable[_T]: ... + + +def nth(n: int, seq: Iterable[_T]) -> _T: ... + + +@overload +def partition(n: int, seq: Iterable[_T]) -> Iterable[Tuple[_T, ...]]: ... + + +@overload +def partition( + n: int, + seq: Iterable[_T], + pad: _T1, +) -> Iterable[Tuple[Union[_T, _T1], ...]]: ... + + +def partition_all(n: int, seq: Iterable[_T]) -> Iterable[Tuple[_T, ...]]: ... + + +def peek(seq: Iterable[_T]) -> Tuple[_T, Iterable[_T]]: ... + + +@overload +def pluck( + ind: Union[int, List[int], str, List[str]], + seqs: Union[List[_T], Dict[Union[str, int], _T]], +) -> Iterable[Tuple[_T, ...]]: ... + + +@overload +def pluck( + ind: Union[int, List[int], str, List[str]], + seqs: Union[List[_T], Dict[Union[str, int], _T]], + default: Union[_T1, str] = no_default, +) -> Iterable[Tuple[Union[_T, _T1], ...]]: ... + + +@overload +def reduceby( + key: Callable[[_T], _T1], + binop: Callable[[_T, _T], _T], + seq: Iterable[_T], +) -> Dict[_T1, _T]: ... + + +# Causes error in mypy by conflicting with first overload +# @overload +# def reduceby( +# key: _K, +# binop: Callable[[Dict[_K, _V], Dict[_K, _V]], Dict[_K, _V]], +# seq: Dict[_K, _V], +# ) -> Dict[_V, Dict[_K, _V]]: ... + + +@overload +def reduceby( + key: _K, + binop: Callable[[_T, Dict[_K, _V]], _T], + seq: Dict[_K, _V], + init: Union[Callable[[], _T], _T], +) -> Dict[_V, _T]: ... + + +@overload +def reduceby( + key: Callable[[_T], _T1], + binop: Callable[[_T2, _T], _T2], + seq: Iterable[_T], + init: Union[Callable[[], _T2], _T2], +) -> Dict[_T1, _T2]: ... + + +# uncomment if necessary +# @overload +# def reduceby(key: Any, binop: Any, seq: Any, init: Any = no_default) -> +# Any: ... + + +# TODO - no documentation +def rest(seq: Any) -> Any: ... + + +def second(seq: Iterable[_T]) -> _T: ... + + +def tail(n: int, seq: Iterable[_T]) -> Iterable[_T]: ... + + +def take(n: int, seq: Iterable[_T]) -> Iterable[_T]: ... + + +def take_nth(n: int, seq: Iterable[_T]) -> Iterable[_T]: ... + + +def topk(k: int, seq: Iterable[_T], key: Any = None) -> Iterable[_T]: ... + + +def unique(seq: Iterable[_T], key: Any = None) -> Iterable[_T]: ... + + +#################################################################### +# TBD +#################################################################### + +def heapify(*args: Any, **kwargs: Any) -> Any: ... + + +def heappop(*args: Any, **kwargs: Any) -> Any: ... + + +def heapreplace(heap: Any, item: Any) -> Any: ... + + +class Random(_Random): + __init__: Any = ... + VERSION: Any = ... + _randbelow: Any = ... + betavariate: Any = ... + choice: Any = ... + choices: Any = ... + expovariate: Any = ... + gammavariate: Any = ... + gauss: Any = ... + getstate: Any = ... + lognormvariate: Any = ... + normalvariate: Any = ... + paretovariate: Any = ... + randint: Any = ... + randrange: Any = ... + sample: Any = ... + seed: Any = ... + setstate: Any = ... + shuffle: Any = ... + triangular: Any = ... + uniform: Any = ... + vonmisesvariate: Any = ... + weibullvariate: Any = ... + __getstate__: Any = ... + __reduce__: Any = ... + __setstate__: Any = ... + + +class accumulate: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class chain: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + @classmethod + def from_iterable(cls, *args: Any, **kwargs: Any) -> Any: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class deque: + maxlen: Any = ... + __hash__: Any = ... + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def append(self, *args: Any, **kwargs: Any) -> Any: ... + + def appendleft(self, *args: Any, **kwargs: Any) -> Any: ... + + def clear(self, *args: Any, **kwargs: Any) -> Any: ... + + def copy(self, *args: Any, **kwargs: Any) -> Any: ... + + def count(self, *args: Any, **kwargs: Any) -> Any: ... + + def extend(self, *args: Any, **kwargs: Any) -> Any: ... + + def extendleft(self, *args: Any, **kwargs: Any) -> Any: ... + + def index(self, *args: Any, **kwargs: Any) -> Any: ... + + def insert(self, *args: Any, **kwargs: Any) -> Any: ... + + def pop(self, *args: Any, **kwargs: Any) -> Any: ... + + def popleft(self, *args: Any, **kwargs: Any) -> Any: ... + + def remove(self, *args: Any, **kwargs: Any) -> Any: ... + + def reverse(self, *args: Any, **kwargs: Any) -> Any: ... + + def rotate(self, *args: Any, **kwargs: Any) -> Any: ... + + def __add__(self, other: Any) -> Any: ... + + def __bool__(self) -> Any: ... + + def __contains__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __copy__(self) -> Any: ... + + def __delitem__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __eq__(self, other: Any) -> Any: ... + + def __ge__(self, other: Any) -> Any: ... + + def __getitem__(self, index: Any) -> Any: ... + + def __gt__(self, other: Any) -> Any: ... + + def __iadd__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __imul__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __iter__(self) -> Iterator: ... + + def __le__(self, other: Any) -> Any: ... + + def __len__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __lt__(self, other: Any) -> Any: ... + + def __mul__(self, other: Any) -> Any: ... + + def __ne__(self, other: Any) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __reversed__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __rmul__(self, other: Any) -> Any: ... + + def __setitem__(self, index: Any, object: Any) -> Any: ... + + def __sizeof__(self) -> Any: ... + + +class interleave: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class interpose: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class islice: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class itemgetter: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + + def __reduce__(self) -> Any: ... + + +class iterate: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class map: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + +class random_sample: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class remove: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class sliding_window: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... + + +class zip: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + +class zip_longest: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Iterator: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... diff --git a/cytoolz-stubs/recipes.pyi b/cytoolz-stubs/recipes.pyi new file mode 100644 index 0000000..3ce895f --- /dev/null +++ b/cytoolz-stubs/recipes.pyi @@ -0,0 +1,20 @@ +# Stubs for cytoolz.recipes (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +countby: Any + + +class partitionby: + + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + + def __iter__(self) -> Any: ... + + def __next__(self) -> Any: ... + + def __reduce__(self) -> Any: ... + + def __setstate__(self, state: Any) -> Any: ... diff --git a/cytoolz-stubs/utils.pyi b/cytoolz-stubs/utils.pyi new file mode 100644 index 0000000..a2bf304 --- /dev/null +++ b/cytoolz-stubs/utils.pyi @@ -0,0 +1,10 @@ +# Stubs for cytoolz.utils (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any + +consume: Any +include_dirs: Any +no_default: str +raises: Any diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a5139e7 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +import os + +from setuptools import setup + + +def find_stubs(package): + stubs = [] + for root, dirs, files in os.walk(package): + for file in files: + path = os.path.join(root, file).replace(package + os.sep, '', 1) + stubs.append(path) + return {package: stubs} + + +requirements = [ + 'cytoolz==0.9.0.1', +] + +test_requirements = [ + 'flake8==3.7.7', +] + +setup( + name='cytoolz-stubs', + maintainer="Martin Matyasek", + maintainer_email="martin.matyasek@blindspot.ai", + description="PEP 561 type stubs for cytoolz", + url="https://github.com/blindspot-ai/cytoolz-stubs", + license='MIT', + version="0.0.1", + packages=['cytoolz-stubs'], + zip_safe=False, + install_requires=requirements, + extras_require={'test': test_requirements}, + tests_require=requirements + test_requirements, + package_data=find_stubs('cytoolz-stubs'), +)