ethereum / eth-keys

A common API for Ethereum key operations.
MIT License
159 stars 64 forks source link

[WIP] Enabling type hinting and updating mypy in tox #45

Closed 6ug closed 5 years ago

6ug commented 5 years ago

[WIP] My next step will be finding out type hinting annotation issues and fixing it manually (going to work on in couple of hours)

What was wrong?

Fixes https://github.com/ethereum/eth-keys/issues/44

How was it fixed?

Applying https://www.python.org/dev/peps/pep-0561/#id18

Cute Animal Picture

Cute animal picture

pipermerriam commented 5 years ago

@6ug I've rebased this branch onto master (which now uses circle ci) and added a single small commit.

One thing that needs to be done is to convert all of the comment based type hints for function signatures to be in the new format. See 13c7aa8 for details.

6ug commented 5 years ago

You were talking about this annotation, right @pipermerriam?

(eth-keys) 🎩 ➜  eth-keys git:(PEP561) 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 eth_keys
eth_keys/datatypes.py:97: error: Incompatible return value type (got "bytes", expected "BaseECCBackend")
eth_keys/datatypes.py:101: error: Incompatible types in assignment (expression has type "BaseECCBackend", variable has type "bytes")

[+edited] Oh! No I got that, you said comment based. Yes, on the way.

pipermerriam commented 5 years ago

Looks like this needs to be rebased and still has some CI errors.

Bhargavasomu commented 5 years ago

The work in this PR has been already taken care in #48, rendering this PR obsolete. Can be closed.