From 5cd74f8f1435d5408e8f04285701de243eb6f257 Mon Sep 17 00:00:00 2001 From: 6ug Date: Fri, 19 Oct 2018 14:32:39 +0530 Subject: [PATCH 1/5] Removed cytoolz hard dependency --- setup.py | 3 +-- trie/utils/binaries.py | 2 +- trie/utils/nibbles.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 7bd419be..3b0082f1 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,8 @@ setup_requires=['setuptools-markdown'], install_requires=[ "eth-hash>=0.1.0,<1.0.0", - "eth-utils>=1.0.1,<2.0.0", + "eth-utils>=1.3.0,<2.0.0", "rlp>=0.4.7,<2.0.0", - "cytoolz>=0.8.0,<1", ], license="MIT", zip_safe=False, diff --git a/trie/utils/binaries.py b/trie/utils/binaries.py index 32a041af..ba976fbd 100644 --- a/trie/utils/binaries.py +++ b/trie/utils/binaries.py @@ -1,7 +1,7 @@ from eth_utils import ( apply_to_return_value, ) -from cytoolz import ( +from eth_utils.toolz import ( partition_all, ) diff --git a/trie/utils/nibbles.py b/trie/utils/nibbles.py index a71001f1..c161abca 100644 --- a/trie/utils/nibbles.py +++ b/trie/utils/nibbles.py @@ -3,7 +3,7 @@ from eth_utils import ( to_tuple, ) -from cytoolz import ( +from eth_utils.toolz import ( partition, ) From a236489d3bd93c3f36abb2e11ce6e296c8f73313 Mon Sep 17 00:00:00 2001 From: 6ug Date: Fri, 19 Oct 2018 15:06:46 +0530 Subject: [PATCH 2/5] Adding eth-typing dependency and enabling type hiting * Fixes first part of https://github.com/ethereum/py-trie/issues/69 TODO: Add all missing type hints --- setup.py | 2 ++ tox.ini | 4 +++- trie/py.typed | 0 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 trie/py.typed diff --git a/setup.py b/setup.py index 3b0082f1..94c8e25d 100644 --- a/setup.py +++ b/setup.py @@ -18,12 +18,14 @@ install_requires=[ "eth-hash>=0.1.0,<1.0.0", "eth-utils>=1.3.0,<2.0.0", + "eth-typing>=2.0.0,<3", "rlp>=0.4.7,<2.0.0", ], license="MIT", zip_safe=False, keywords='ethereum blockchain evm trie merkle', packages=find_packages(exclude=["tests", "tests.*"]), + package_data={'trie': ['py.typed']}, classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', diff --git a/tox.ini b/tox.ini index cbb2deff..464a7736 100644 --- a/tox.ini +++ b/tox.ini @@ -23,4 +23,6 @@ basepython = [testenv:lint] basepython=python deps=flake8 -commands=flake8 {toxinidir}/trie {toxinidir}/tests +commands= + flake8 {toxinidir}/trie {toxinidir}/tests + mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional --check-untyped-defs --disallow-incomplete-defs --disallow-untyped-defs --disallow-any-generics -p py-trie diff --git a/trie/py.typed b/trie/py.typed new file mode 100644 index 00000000..e69de29b From 43b72becf0128a793628854066a11c8679bc41c5 Mon Sep 17 00:00:00 2001 From: 6ug Date: Fri, 19 Oct 2018 15:23:01 +0530 Subject: [PATCH 3/5] Adding python 3.7 support Fixes https://github.com/ethereum/py-trie/issues/67 * Updated classifiers in setup.py * Added python3.7 to tox.ini * Added python3.7 run(s) to .travis.yml TODO: Fix any issues or failures that are exposed. --- .travis.yml | 4 ++++ setup.py | 2 ++ tox.ini | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7db1dab9..4f503b55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,10 @@ matrix: env: TOX_POSARGS="-e py36-rlp0" - python: "3.6" env: TOX_POSARGS="-e py36-rlp1" + - python: "3.7" + env: TOX_POSARGS="-e py37-rlp0" + - python: "3.7" + env: TOX_POSARGS="-e py37-rlp1" - python: "pypy3.5" env: TOX_POSARGS="-e pypy3-rlp0" - python: "pypy3.5" diff --git a/setup.py b/setup.py index 94c8e25d..92824db7 100644 --- a/setup.py +++ b/setup.py @@ -34,5 +34,7 @@ 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: Implementation :: PyPy', ], ) diff --git a/tox.ini b/tox.ini index 464a7736..ddc3733f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist= - py{35,36,py3}-rlp{0,1} + py{35,36,37,py3}-rlp{0,1} lint [flake8] @@ -18,6 +18,7 @@ deps = basepython = py35: python3.5 py36: python3.6 + py37: python3.7 pypy3: pypy3 [testenv:lint] From e74d50c02a270ca32c017bce88717bb6ee03b098 Mon Sep 17 00:00:00 2001 From: 6ug Date: Fri, 19 Oct 2018 23:52:47 +0530 Subject: [PATCH 4/5] Removed travis.yml and updated version --- .travis.yml | 36 ------------------------------------ setup.py | 2 +- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4f503b55..00000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -sudo: false -language: python -dist: trusty -matrix: - include: - # lint - - python: "3.5" - env: TOX_POSARGS="-e lint" - # core - - python: "3.5" - env: TOX_POSARGS="-e py35-rlp0" - - python: "3.5" - env: TOX_POSARGS="-e py35-rlp1" - - python: "3.6" - env: TOX_POSARGS="-e py36-rlp0" - - python: "3.6" - env: TOX_POSARGS="-e py36-rlp1" - - python: "3.7" - env: TOX_POSARGS="-e py37-rlp0" - - python: "3.7" - env: TOX_POSARGS="-e py37-rlp1" - - python: "pypy3.5" - env: TOX_POSARGS="-e pypy3-rlp0" - - python: "pypy3.5" - env: TOX_POSARGS="-e pypy3-rlp1" -cache: - pip: true -install: - - "travis_retry pip install pip setuptools --upgrade" - - "travis_retry pip install tox" -before_script: - - pip freeze -script: - - tox $TOX_POSARGS -after_script: - - cat .tox/$TOX_POSARGS/log/*.log diff --git a/setup.py b/setup.py index 92824db7..b1f0db72 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup_requires=['setuptools-markdown'], install_requires=[ "eth-hash>=0.1.0,<1.0.0", - "eth-utils>=1.3.0,<2.0.0", + "eth-utils>=1.2.2,<2.0.0", "eth-typing>=2.0.0,<3", "rlp>=0.4.7,<2.0.0", ], From dc9412a5ebff2317c41ead76a0db6f1f64507c91 Mon Sep 17 00:00:00 2001 From: 6ug Date: Sat, 20 Oct 2018 05:41:09 +0530 Subject: [PATCH 5/5] Added mypy to req --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 68a7178f..df0773a7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,3 +4,4 @@ hypothesis==3.7.0 bumpversion==0.5.3 eth-hash[pycryptodome]>=0.1.0,<1.0.0 twine==1.11.0 +mypy==0.641 \ No newline at end of file