Updates for the latest eth-testrpc

This commit is contained in:
Piper Merriam 2016-12-06 08:54:02 -07:00
parent d5f8ea9f59
commit f0deb65ff1
3 changed files with 13 additions and 6 deletions

View File

@ -10,7 +10,6 @@
A python implementation of [web3.js](https://github.com/ethereum/web3.js)
* Python 2.7, 3.4, 3.5 support
* Largely feature-for-feature python implementation of Web3.js
## Installation
@ -23,8 +22,14 @@ pip install web3
### Testing
For testing you can use the `TestRPCProvider`. This depends on
`eth-testrpc>=0.8.4` which must be installed independently (It is not included
as a hard dependency for this package.)
`eth-testrpc>=0.9.0` which must be eithe installed independently or with the
following installation command.
```sh
pip install web3[TestRPCProvider]
```
Then in your code:
```python

View File

@ -33,6 +33,9 @@ setup(
"pysha3>=0.3",
"pylru>=1.0.9",
],
extras_require={
'TestRPCProvider': ["eth-testrpc>=0.9.0"],
},
py_modules=['web3'],
license="MIT",
zip_safe=False,

View File

@ -176,15 +176,14 @@ class TestRPCProvider(RPCProvider):
if not is_testrpc_available():
raise Exception("`TestRPCProvider` requires the `eth-testrpc` package to be installed")
from gevent.pywsgi import WSGIServer
from testrpc.server import application
from testrpc.testrpc import evm_reset
from testrpc.server import get_application
try:
logger = kwargs.pop('logger')
except KeyError:
logger = logging.getLogger('testrpc')
evm_reset()
application = get_application()
self.server = WSGIServer(
(host, port),