Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility of python sdk with eth-brownie #2693

Closed
madlabman opened this issue Dec 19, 2022 · 6 comments
Closed

Incompatibility of python sdk with eth-brownie #2693

madlabman opened this issue Dec 19, 2022 · 6 comments
Labels
bug Something isn't working as expected

Comments

@madlabman
Copy link

madlabman commented Dec 19, 2022

Describe the bug

Installation of eth-brownie alongside trezor package breaks eth-brownie because of conflicting packages rlp a.k.a pyrlp used by brownie and simple-rlp used by trezor. Both packages provides the module with the same name rlp which causes ambiguity and broken dependencies setup.

Firmware version and revision

eth-brownie==1.19.2
trezor==0.13.4

To Reproduce

Steps to reproduce the behavior:

  1. Create new project
  2. Run pip install eth-brownie==1.19.2
  3. Run pip install trezor==0.13.4
  4. Run brownie console
  5. See error:
<...>
Traceback (most recent call last):
  File ".direnv/python-3.9.16/bin/brownie", line 5, in <module>
    from brownie._cli.__main__ import main
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/brownie/__init__.py", line 6, in <module>
    from brownie.project import compile_source, run
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/brownie/project/__init__.py", line 3, in <module>
    from .main import (  # NOQA 401
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/brownie/project/main.py", line 45, in <module>
    from brownie.network import web3
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/brownie/network/__init__.py", line 4, in <module>
    from .account import Accounts
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/brownie/network/account.py", line 13, in <module>
    import eth_account
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/eth_account/__init__.py", line 1, in <module>
    from eth_account.account import (
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/eth_account/account.py", line 35, in <module>
    from eth_account._utils.legacy_transactions import (
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/eth_account/_utils/legacy_transactions.py", line 13, in <module>
    from eth_rlp import (
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/eth_rlp/__init__.py", line 1, in <module>
    from .main import (  # noqa: F401
  File ".direnv/python-3.9.16/lib/python3.9/site-packages/eth_rlp/main.py", line 13, in <module>
    class HashableRLP(rlp.Serializable):
AttributeError: module 'rlp' has no attribute 'Serializable'

Expected behavior

Brownie runs its command.

@madlabman madlabman added the bug Something isn't working as expected label Dec 19, 2022
@prusnak
Copy link
Member

prusnak commented Dec 19, 2022

This sounds like a problem that should be reported to brownie since trezor works as expected.

@matejcik is there any way around this? (as in what should brownie fix on their side?)

@madlabman
Copy link
Author

Hey, @prusnak! Both projects work as expected without each other. I've reported here because it's much more possible imho for trezor project e.g. to move to pyrlp project. The alternative way is to ask simple-rlp maintainer to avoid using rlp as module name but it will require updates from trezor side as well.

@prusnak
Copy link
Member

prusnak commented Dec 19, 2022

imho for trezor project e.g. to move to pyrlp project.

We will not move to pyrlp project, because we've already been there and we only need simple-rlp which has much less dependency footprint.

@matejcik
Copy link
Contributor

The reason for moving away from pyrlp is that pyrlp has a dependency on eth-utils and eth-utils are very dependency-heavy, very particular about their preferred versions of things (like Cython even, iirc?) and have caused major dependency related headaches in the past.

I would consider moving simple-rlp to an extra trezor[ethereum] but this has the drawback that then trezorctl ethereum * doesn't work out of the box.

User-side, you should be able to get around this by manually uninstalling simple-rlp and installing pyrlp instead, Trezor code should work fine with either.
I don't know how to express this as an install requirement though.

Brownie-side, no idea honestly. Switch to simple-rlp also :)

@prusnak
Copy link
Member

prusnak commented Dec 19, 2022

I would consider moving simple-rlp to an extra trezor[ethereum] but this has the drawback that then trezorctl ethereum * doesn't work out of the box.

I would prefer not doing this. This is an issue between pyrlp, simple-rlp and brownie. So let them figure it out without crippling our out-of-the-box user experience.

@madlabman
Copy link
Author

Thank you for your response! I agree that effortless for users of trezor is in priority. I also strongly support an idea of using less coupled dependencies. The sad thing is partially compatible API of rlp replacement library in that case. But since @matejcik mentions that trezor is compatible with pyrlp we have a workaround at least.

@matejcik matejcik closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
Archived in project
Development

No branches or pull requests

3 participants