ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.95k stars 1.69k forks source link

change linting to use pre-commit #3297

Closed pacrob closed 5 months ago

pacrob commented 5 months ago

What was wrong?

pre-commit is totally rad and we should use it for web3 v7!

How was it fixed?

Added pre-commit, removed previous linting setup, moved config to pyproject.toml where possible.

To aid in review, I've made one commit for each new lint tool. It's still a big pr but should be more manageable that way.

Todo:

Cute Animal Picture

image

pacrob commented 5 months ago

I've cleaned up per comments. All added casts have been removed as unneeded due to setting mypy's warn_return_any = false.

There are 4 remaining B008 rule ignores. 2 are related to ENS. Fails these tests: tests/ens/test_setup*.py

The other 2 are related to HTTP provider retry config. Removing them fails: tests/core/providers/test_http_request_retry.py

I tried a few things to fix them but no dice. Let me know if you'd like to try to fix them here or open a new issue to deal with them separately.