Skip to content

refactor(all): Enforce all execution-specs mypy rules#2281

Merged
marioevz merged 44 commits into
mainfrom
eels-mypy-rules
Oct 9, 2025
Merged

refactor(all): Enforce all execution-specs mypy rules#2281
marioevz merged 44 commits into
mainfrom
eels-mypy-rules

Conversation

@marioevz

@marioevz marioevz commented Oct 8, 2025

Copy link
Copy Markdown
Member

🗒️ Description

This is a collaborative branch/PR to distribute the work required to fix all broken mypy rules.

Instructions

  1. Checkout this branch (eels-mypy-rules) locally
  2. Select a folder path to work on, preferably a folder that you actively worked on before.
  3. Add your username to the assignee column for the selected folder (Very important to not duplicate work!).
  4. Use uv run --with=mypy mypy path/to/folder to verify the errors locally.
  5. Try using uv run --with libcst add_none_returns.py path/to/folder first to see if it fixes most of the issues. Use claude's prompt below to start the type fixing process.
  6. Fix the rest of the issues manually.
  7. Run uvx --with=tox-uv tox -e lint,pytest to verify that everything is still working.
  8. Fetch and rebase to sync up with the latest version of the branch.
  9. Push to the branch the commit that contain your fixes (Use commit message refactor(path/to/folder): Enforce all execution-specs mypy rules when possible so we can rebase merge this PR).
  10. Repeat for the next folder.

Claude Prompt

Help me fix all the typing errors that occur when running uv run mypy src/ethereum_test_vm. Make sure to use Self when possible because this codebase always runs on python 3.11+.

Work Folders

Complete ✅ Path Errors Assignee
tests/unscheduled 408 @LouisTsai-Csie
src/pytest_plugins/filler/ 245 @fselmo
src/pytest_plugins/execute/ 83 @fselmo
src/pytest_plugins/consume/ 62 @marioevz
src/pytest_plugins/forks/ 31 @marioevz
src/pytest_plugins/custom_logging/ 29 @marioevz
src/pytest_plugins/shared/ 14 @marioevz
src/pytest_plugins/pytest_hive/ 13 @fselmo
src/pytest_plugins/solc/ 5 @fselmo
src/pytest_plugins/help/ 5 @fselmo
src/pytest_plugins/spec_version_checker/ 4 @fselmo
src/pytest_plugins/eels_resolver.py 2 @fselmo
src/pytest_plugins/fix_package_test_path.py 1 @fselmo
tests/prague 206 @LouisTsai-Csie
tests/cancun 137 @LouisTsai-Csie
src/cli 124 @fselmo
src/ethereum_test_types 86 @marioevz
src/ethereum_test_specs 84 @marioevz
tests/benchmark 83 @LouisTsai-Csie
tests/osaka 77 @LouisTsai-Csie
tests/amsterdam 49 @LouisTsai-Csie
src/ethereum_test_fixtures 49 @marioevz
src/ethereum_test_base_types 48 @marioevz
src/ethereum_clis 47 @fselmo
src/ethereum_test_tools 31 @LouisTsai-Csie
tests/shanghai 28 @marioevz
tests/frontier 28 @LouisTsai-Csie
src/ethereum_test_forks 28 @marioevz
src/ethereum_test_vm 15 @marioevz
src/ethereum_test_rpc 12 @LouisTsai-Csie
src/ethereum_test_checklists 9 @LouisTsai-Csie
tests/istanbul 7 @LouisTsai-Csie
tests/constantinople 5 @LouisTsai-Csie
tests/berlin 5 @LouisTsai-Csie
src/ethereum_test_exceptions 5 @LouisTsai-Csie
src/ethereum_test_execution 4 @fselmo
.github/scripts 4 @LouisTsai-Csie
tests/homestead 3 @LouisTsai-Csie
tests/byzantium 2 @LouisTsai-Csie
tests/paris 1 @LouisTsai-Csie
src/config 1 @LouisTsai-Csie

🔗 Related Issues or PRs

Fixes ethereum/execution-specs#1477

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

@marioevz marioevz added type:refactor Type: Refactor Finalize Weld Tracks issues/PRs that are necessary to bring the weld to completion. labels Oct 8, 2025
@LouisTsai-Csie LouisTsai-Csie force-pushed the eels-mypy-rules branch 2 times, most recently from 67735eb to 0195a0f Compare October 9, 2025 16:29
@LouisTsai-Csie

Copy link
Copy Markdown
Collaborator

@marioevz i've pushed all my changes. We have reduced the number to only 5 remaining file!

Currently there is one failure for evmone for frontier fork, imo this is due to some typing inconsistency, not logic changes.

@marioevz

marioevz commented Oct 9, 2025

Copy link
Copy Markdown
Member Author

Split src/pytest_plugins into its subfolders so we can take a few at a time.

@fselmo fselmo force-pushed the eels-mypy-rules branch 2 times, most recently from 0e2738e to 707d91c Compare October 9, 2025 18:16
@marioevz marioevz marked this pull request as ready for review October 9, 2025 21:13
LouisTsai-Csie and others added 24 commits October 9, 2025 22:23
…cs mypy rule

refactor(plugins/eels_resolver): More fixes
@marioevz

marioevz commented Oct 9, 2025

Copy link
Copy Markdown
Member Author

I've diff'd the fixtures before and after this PR using the following fill command:

uv run fill --output ../fixtures.base/ --until=Prague -m "not slow" -n auto

And then diff'd using hasher:

➜  execution-spec-tests git:(main) uv run hasher -r ../fixtures.base
0x6638cacbd017bc997fde90573b33d0eda091ce9f164eeb7c161d2b3e1dd087da
➜  execution-spec-tests git:(main) uv run hasher -r ../fixtures.patch
0x6638cacbd017bc997fde90573b33d0eda091ce9f164eeb7c161d2b3e1dd087da

And both resulted in the exact same output, which means that the fixture generation was correctly unaffected by this PR and we should be able to proceed and merge.

The issue in https://github.com/ethereum/execution-spec-tests/actions/runs/18390717568/job/52400137583?pr=2281 might be related to evmone (it fails during the execution of tests from the main branch, not the PR), but it seems to me that it's outside of the scope of this PR.

We could create an issue on the evmone repository to follow this up.

@fselmo fselmo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've diff'd the fixtures before and after this PR

I also diff'd the "failing" tests and they are exactly the same. This lgtm 👍🏼

@marioevz marioevz merged commit ca37419 into main Oct 9, 2025
15 of 16 checks passed
@marioevz marioevz deleted the eels-mypy-rules branch October 9, 2025 23:20
kclowes pushed a commit to kclowes/execution-spec-tests that referenced this pull request Oct 20, 2025
* refactor(pyproject): Enforce all execution-specs mypy rules

* refactor(base_types): Enforce all execution-specs mypy rules

* refactor(types): Enforce all execution-specs mypy rules

* refactor(vm): Enforce all execution-specs mypy rules

* refactor(forks): Enforce all execution-specs mypy rules

* refactor(tests/shanghai): Enforce all execution-specs mypy rules

* refactor(fixtures): Enforce all execution-specs mypy rules

* refactor(tests/benchmark): Enforce all execution-specs mypy rules

* refactor(tests/osaka): Enforce all execution-specs mypy rules

refactor(tests/osaka): More fixes

* refactor(tests/prague): Enforce all execution-specs mypy rules

refactor(tests/prague): More fixes

* refactor(tests/cancun): Enforce all execution-specs mypy rules

* refactor(tests/homestead): Enforce all execution-specs mypy rules

* refactor(tests/frontier): Enforce all execution-specs mypy rules

* refactor(tests/istanbul): Enforce all execution-specs mypy rules

* refactor(tests/constantinople): Enforce all execution-specs mypy rules

* refactor(tests/berlin): Enforce all execution-specs mypy rules

* refactor(tests/byzantium): Enforce all execution-specs mypy rules

* refactor(tests/paris): Enforce all execution-specs mypy rules

* refactor(tests/amsterdam): Enforce all execution-specs mypy rules

* refactor(tests/unscheduled): Enforce all execution-specs mypy rules

* fix linting issue

* refactor(src/ethereum_test_exceptions): Enforce all execution-specs mypy rules

* refactor(.github/scripts): Enforce all execution-specs mypy rules

* fix typing issue after rebase

* refactor(src/ethereum_test_tools): Enforce all execution-specs mypy rules

* refactor(src/config): Enforce all execution-specs mypy rules

* refactor(src/ethereum_test_checklists): Enforce all execution-specs mypy rules

* refactor(src/ethereum_test_rpc): Enforce all execution-specs mypy rules

* fix issue after rebase

* refactor(specs): Enforce all execution-specs mypy rules

* refactor(src/cli,src/ethereum_clis): Enforce all execution-specs mypy rule

refactor(clis): More fixes

* refactor(src/ethereum_test_execution): Enforce all execution-specs mypy rule

* refactor(plugins/forks): Enforce all execution-specs mypy rules

refactor(plugins/forks): More fixes

* refactor(plugins/logging): Enforce all execution-specs mypy rules

* refactor(src/pytest_plugins/solc): Enforce all execution-specs mypy rule

refactor(plugins/solc): More fixes

* refactor(src/pytest_plugins/help): Enforce all execution-specs mypy rule

* refactor(src/pytest_plugins/eels_resolver): Enforce all execution-specs mypy rule

refactor(plugins/eels_resolver): More fixes

* refactor(src/pytest_plugins/fix_package_test_path): Enforce all execution-specs mypy rule

* refactor(src/pytest_plugins/execute): Enforce all execution-specs mypy rule

refactor(plugins/execute): More fixes

* refactor(plugins/consume): Enforce all execution-specs mypy rules

* refactor(src/pytest_plugins/filler): Enforce all execution-specs mypy rule

refactor(plugins/filler): More fixes

* refactor(src/pytest_plugins/spec_version_checker): Enforce all execution-specs mypy rule

* refactor(src/pytest_plugins/pytest_hive): Enforce all execution-specs mypy rule

* refactor(plugins/shared): Enforce all execution-specs mypy rules

---------

Co-authored-by: LouisTsai <q1030176@gmail.com>
Co-authored-by: fselmo <fselmo2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finalize Weld Tracks issues/PRs that are necessary to bring the weld to completion. type:refactor Type: Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce all execution-specs mypy rules

3 participants