Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 213] migrate to cytoolz library #222

Merged
merged 2 commits into from
Aug 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"pysha3>=0.3",
"requests>=2.12.4",
"rlp>=0.4.7",
"toolz>=0.8.2",
"cytoolz>=0.8.2",
]

if sys.platform == 'win32':
Expand Down
2 changes: 1 addition & 1 deletion web3/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
DecodingError,
)

from toolz.functoolz import (
from cytoolz.functoolz import (
compose,
)

Expand Down
23 changes: 13 additions & 10 deletions web3/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
import operator

from eth_utils import (
add_0x_prefix,
coerce_args_to_text,
coerce_return_to_text,
compose as _compose,
decode_hex,
encode_hex,
is_0x_prefixed,
is_address,
is_string,
is_integer,
is_null,
is_dict,
is_0x_prefixed,
add_0x_prefix,
encode_hex,
decode_hex,
is_integer,
is_list_like,
is_null,
is_string,
to_normalized_address,
)

from toolz.functoolz import (
from cytoolz.functoolz import (
compose,
)

Expand Down Expand Up @@ -71,9 +72,11 @@ def inner(value):


def apply_to_array(formatter_fn):
return compose(
list,
# workaround for https://github.com/pytoolz/cytoolz/issues/103
# NOTE: must reverse arguments when migrating from _compose to cytoolz.compose
return _compose(
functools.partial(map, formatter_fn),
list,
)


Expand Down
2 changes: 1 addition & 1 deletion web3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
coerce_return_to_text,
)

from toolz.functoolz import (
from cytoolz.functoolz import (
compose,
)

Expand Down
2 changes: 1 addition & 1 deletion web3/utils/functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import functools

from toolz.functoolz import (
from cytoolz.functoolz import (
compose,
)

Expand Down