ethereum / eth-typing

Python types for type hinting commonly used ethereum types
MIT License
31 stars 35 forks source link

Enable discovery of type hints as per PEP561 #10

Closed cburgdorf closed 6 years ago

cburgdorf commented 6 years ago

What was wrong?

The eth_typing module was born to codify stronger type guarantees for things that previously could only expressed broadly.

Example: An API should only accept things of type Hash32 instead of any bytes.

This worked fine for when we had this module as part of the Trinity code base. However, some of these types naturally spread across multiple code bases and hence we created a standalone repository (this one).

Unfortunately before PEP561 using type information from 3rd party libraries was pretty much useless and the only way to work around it was to setup stubs and make mypy aware of them.

Since we didn't have any stubs for eth-typing, ironically our effort to limit something as broadly defined as bytes now became Any (without us noticing since we don't have such strict mypy checks enabled for Trinity yet).

How was it fixed?

Configure package to distribute type information to be picked up by mypy in packages using eth-typing.

Cute Animal Picture

put a cute animal picture link inside the parentheses

cburgdorf commented 6 years ago

I guess before we release this, we should probably first fix related issues in Trinity

https://github.com/ethereum/py-evm/issues/1272#issuecomment-420569582

Heads up @njgheorghita and @davesque you should probably check for issues in eth-pm that will result from this.

Just pull this branch locally and then to pip install -e /path/to/eth-typing/on/my/machine to figure out what parts are affected.

pipermerriam commented 6 years ago

Lets just do a full major version bump.

cburgdorf commented 6 years ago

Ah yes. :+1: I don't think I can do this.