nucypher / nucypher-ops

GNU General Public License v3.0
3 stars 8 forks source link

Add web3 to requirements #11

Closed theref closed 2 years ago

theref commented 2 years ago

When running nucypher-ops ursula defund I got:

  File "/Users/jamescampbell/.local/pipx/venvs/nucypher-ops/lib/python3.10/site-packages/nucypher_ops/ops/fleet_ops.py", line 64, in inner
    w3 = web3.Web3(web3.Web3.HTTPProvider(provider))
UnboundLocalError: local variable 'web3' referenced before assignment
vepkenez commented 2 years ago

@theref I really appreciate the PR.

The intention was to avoid requiring web3 because it's kind of a "heavy lift" for installation and it's not really required for the core operation of things. It's kind of a luxury.

the code there in that spot where you got that failure is written like

        try:
            import web3
        except ImportError:
            self.emitter.echo("web3 must be installed to use this functionality ('pip install web3')")
        w3 = web3.Web3(web3.Web3.HTTPProvider(provider))
        return method(self, w3, *args, **kwargs)

I think I need to look for something more than just ImportError?

theref commented 2 years ago

Ah ok, i think it's a ModuleNotFoundError

vepkenez commented 2 years ago

Yep, just tested it. Also, I actually need to stop execution after the error message... right now it just continues on and discovers the UnboundLocalError

vepkenez commented 2 years ago

fixed in https://github.com/nucypher/nucypher-ops/releases/tag/v0.11.1