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

feat: support web3.py v7 (in addition to v6) #2394

Merged
merged 12 commits into from
Dec 6, 2024

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Dec 2, 2024

What I did

work was already done in another branch but after discussing with @fubuloubu a couple weeks ago, we are going to push forward with it before 0.9

How I did it

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

fubuloubu
fubuloubu previously approved these changes Dec 2, 2024
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to make it work with both v6 and v7?

@antazoey
Copy link
Member Author

antazoey commented Dec 2, 2024

Is there any way to make it work with both v6 and v7?

Yes we can, but the tests will probably only run on v7 unless we add another dimension to the matrix (which I try to avoid).

@antazoey
Copy link
Member Author

antazoey commented Dec 2, 2024

Is there any way to make it work with both v6 and v7?

Another thing to note! Getting it to work on both is easy, but where we fudged up is the plugins: they have no pins for peer ape dependencies with comment (# Use same version as eth-ape) which seemed like a good idea at the time but actually wasn't... because now plugins may be importing stuff from web3 v6 even if you install web3 v7 and things won't fail until runtime... so I still need to fix allll the plugins here at the same time if we are to go through with this (as well as add pins for web3 stuff in each plugin)

@antazoey antazoey changed the title feat: upgrade web3.py feat: support web3.py v7 (in addition to v6) Dec 2, 2024
@fubuloubu
Copy link
Member

Is there any way to make it work with both v6 and v7?

Yes we can, but the tests will probably only run on v7 unless we add another dimension to the matrix (which I try to avoid).

that sounds fine, I just want to avoid unintentially rugging people on the older version, at least until v0.9 where we can drop v6

fubuloubu
fubuloubu previously approved these changes Dec 3, 2024
NotPeopling2day
NotPeopling2day previously approved these changes Dec 4, 2024
fubuloubu
fubuloubu previously approved these changes Dec 4, 2024
@antazoey antazoey dismissed stale reviews from fubuloubu and NotPeopling2day via a452e4d December 4, 2024 20:42
request_header: dict = {
"User-Agent": construct_user_agent(str(HTTPProvider)),
}
request_header: dict = {"User-Agent": f"EthereumNodeProvider/web3.py/{web3_version}"}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to reviewer: this basically makes it the same as it was before, v7 changes this method to make it more web3-specific by including a required module arg

@antazoey antazoey merged commit df7d7a1 into ApeWorX:main Dec 6, 2024
20 checks passed
@antazoey antazoey deleted the feat/upgrade-web3 branch December 6, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants