Skip to content

Commit

Permalink
Merge pull request #138 from stefanmendoza/issue-111
Browse files Browse the repository at this point in the history
Use eth_utils.toolz aliasing for cytoolz/toolz
  • Loading branch information
carver authored Oct 16, 2018
2 parents fb6d5b9 + 23bd953 commit 8719326
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 87 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pip install eth-tester
## Development

```sh
pip install -e . -r requirements-dev.txt
pip install -e ".[dev]"
```


Expand Down
2 changes: 1 addition & 1 deletion eth_tester/backends/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cytoolz.dicttoolz import merge
from eth_utils.toolz import merge


def merge_genesis_overrides(defaults, overrides):
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/backends/mock/factory.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import functools
import time

from cytoolz.dicttoolz import (
assoc,
)

from eth_utils import (
apply_to_return_value,
is_bytes,
Expand All @@ -19,6 +15,10 @@
to_tuple,
)

from eth_utils.toolz import (
assoc,
)

from eth_tester.backends.common import merge_genesis_overrides
from eth_tester.utils.accounts import (
generate_contract_address,
Expand Down
16 changes: 7 additions & 9 deletions eth_tester/backends/mock/main.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import itertools
import copy

from cytoolz.dicttoolz import (
dissoc,
assoc,
)
from cytoolz.functoolz import (
compose,
partial,
)

from eth_utils import (
decode_hex,
int_to_big_endian,
Expand All @@ -20,6 +11,13 @@
is_integer,
)

from eth_utils.toolz import (
assoc,
compose,
dissoc,
partial,
)

from eth_tester.backends.base import (
BaseChainBackend,
)
Expand Down
6 changes: 2 additions & 4 deletions eth_tester/backends/mock/serializers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from cytoolz.dicttoolz import (
from eth_utils.toolz import (
assoc,
)
from cytoolz.functoolz import (
pipe,
partial,
pipe,
)


Expand Down
10 changes: 5 additions & 5 deletions eth_tester/backends/pyevm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

import time

from cytoolz import (
frequencies,
assoc,
)

import rlp

from eth_abi import (
Expand All @@ -25,6 +20,11 @@
is_integer,
)

from eth_utils.toolz import (
assoc,
frequencies,
)

from eth_keys import KeyAPI

from eth_tester.constants import (
Expand Down
22 changes: 9 additions & 13 deletions eth_tester/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@
import time
import functools

from cytoolz import (
dissoc,
assoc
)
from cytoolz.itertoolz import (
remove,
)
from cytoolz.functoolz import (
compose,
excepts,
partial,
)

from eth_utils import (
is_integer,
is_same_address,
Expand All @@ -28,6 +15,15 @@
to_int
)

from eth_utils.toolz import (
assoc,
dissoc,
remove,
compose,
excepts,
partial,
)

from eth_tester.backends import (
get_chain_backend,
)
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/normalization/common.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from cytoolz.functoolz import (
curry,
)

from eth_utils import (
to_dict,
to_tuple,
)

from eth_utils.toolz import (
curry,
)


@curry
@to_dict
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/normalization/default.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from cytoolz import (
identity,
)

from eth_utils import (
decode_hex,
encode_hex,
to_canonical_address,
)

from eth_utils.toolz import (
identity,
)

from .base import (
BaseNormalizer,
)
Expand Down
10 changes: 5 additions & 5 deletions eth_tester/normalization/inbound.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from __future__ import absolute_import

from cytoolz.functoolz import (
identity,
partial,
)

from eth_utils.curried import (
apply_one_of_formatters,
decode_hex,
Expand All @@ -16,6 +11,11 @@
to_tuple,
)

from eth_utils.toolz import (
identity,
partial,
)

from .common import (
normalize_array,
normalize_dict,
Expand Down
12 changes: 6 additions & 6 deletions eth_tester/normalization/outbound.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
from __future__ import absolute_import

from cytoolz.functoolz import (
partial,
identity,
compose,
)

from eth_utils.curried import (
apply_one_of_formatters,
to_checksum_address,
Expand All @@ -16,6 +10,12 @@
is_dict,
)

from eth_utils.toolz import (
compose,
identity,
partial,
)

from .common import (
normalize_if,
normalize_dict,
Expand Down
12 changes: 6 additions & 6 deletions eth_tester/utils/backend_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

import pytest

from cytoolz.dicttoolz import (
merge,
assoc,
dissoc,
)

import rlp

from eth_utils import (
Expand All @@ -19,6 +13,12 @@
denoms,
)

from eth_utils.toolz import (
assoc,
dissoc,
merge,
)

from eth_keys import (
keys,
)
Expand Down
10 changes: 5 additions & 5 deletions eth_tester/utils/encoding.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from __future__ import unicode_literals

from cytoolz.functoolz import (
compose,
curry,
)

from eth_utils import (
int_to_big_endian,
)

from eth_utils.toolz import (
compose,
curry,
)


@curry
def zpad(value, length):
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/utils/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import functools

from cytoolz.functoolz import (
curry,
)

from eth_utils import (
to_dict,
to_list,
)

from eth_utils.toolz import (
curry,
)


def hex_to_integer(value):
return int(value, 16)
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/validation/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import math

from cytoolz import (
curry,
)

import functools

from eth_utils import (
Expand All @@ -19,6 +15,10 @@
to_tuple,
)

from eth_utils.toolz import (
curry,
)

from eth_tester.constants import (
UINT256_MAX,
UINT8_MAX,
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/validation/inbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import binascii

from cytoolz import (
partial,
)

from eth_utils import (
is_boolean,
is_checksum_address,
Expand All @@ -21,6 +17,10 @@
decode_hex,
)

from eth_utils.toolz import (
partial,
)

from eth_tester.constants import (
BLOCK_NUMBER_META_VALUES,
)
Expand Down
8 changes: 4 additions & 4 deletions eth_tester/validation/outbound.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import unicode_literals

from cytoolz import (
partial,
)

from eth_utils import (
is_canonical_address,
)

from eth_utils.toolz import (
partial,
)

from eth_tester.constants import (
UINT256_MAX,
UINT2048_MAX,
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@
url='https://github.com/ethereum/eth-tester',
include_package_data=True,
install_requires=[
"toolz>0.8.2,<1;implementation_name=='pypy'",
"cytoolz>=0.8.2,<1.0.0;implementation_name=='cpython'",
"eth-abi>=1.2.1,<2",
"eth-keys>=0.2.0-beta.3,<0.3.0",
"eth-utils>=1.1.1,<2.0.0",
"rlp>=0.6.0,<2.0.0",
"semantic_version>=2.6.0,<3.0.0",
"eth-keys>=0.2.0-beta.3,<0.3.0",
"eth-abi>=1.0.0-beta.1,<2",
],
extras_require=extras_require,
python_requires='>=3.5.3,<4',
setup_requires=['setuptools-markdown'],
py_modules=['eth_tester'],
license="MIT",
Expand Down

0 comments on commit 8719326

Please sign in to comment.