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

add py312 support #1

Merged
merged 46 commits into from
Mar 2, 2025
Merged

add py312 support #1

merged 46 commits into from
Mar 2, 2025

Conversation

Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Mar 2, 2025

What was wrong?

Related to Issue #
Closes #

How was it fixed?

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Summary by Sourcery

Adds support for Python 3.13 to the project, updating the CI configuration, Makefile, pyproject.toml, README, tox.ini, pre-commit-config.yaml, setup.py, and documentation.

Enhancements:

  • Updates the Makefile with new commands for documentation, packaging, and release management.
  • Updates the pyproject.toml file with new settings for autoflake, isort, mypy, flake8, and towncrier.
  • Updates the README with installation instructions and links to documentation and changelog.

CI:

  • Adds Python 3.13 to the CI build matrix.
  • Updates the documentation build environment to use Python 3.10.
  • Adds a job to store documentation artifacts.
  • Updates the CI configuration to use cimg/python:3.13 docker image for Python 3.13 jobs.
  • Renames py312 jobs to py313 in the CI configuration.
  • Adds a nightly workflow to run all jobs on a schedule.
  • Adds a check for .rst files in the top-level directory in pre-commit-config.yaml.
  • Adds blocklint to pre-commit-config.yaml.

Tests:

  • Adds a test to verify that the eth package can be imported and that the version attribute is a string.

pacrob and others added 30 commits January 9, 2024 12:06
clean up test_import_and_version
clean up test_import_and_version
Drop the `install pre-commit` step here, as it is installed for all linting ci via the tox env deps
Add `pre-commit install` here since it was removed from ci config
* `sphinx-autobuild` for live docs updates.

* Use Python 3.9 and `sphinx-autobuild` `2024.2.4`
add `python -m` to the Makefile `test` command
drop sphinx-autobuild dep back to allow py3.8 to install
* Store artifacts in docs CI

* Force `pytest` import above all else
remove unneeded upstream git check
@Dargon789 Dargon789 self-assigned this Mar 2, 2025
Copy link

sourcery-ai bot commented Mar 2, 2025

Reviewer's Guide by Sourcery

This pull request adds support for Python 3.13, updates dependencies, improves documentation, and refactors code for better type safety and maintainability. It also includes changes to the CI configuration, Makefile, pyproject.toml, README.md, tox.ini, and pre-commit-config.yaml files.

Updated class diagram for BaseBlock

classDiagram
    class BaseBlock {
        +transaction_builder
        +__init__(header: BlockHeaderAPI, transactions: Sequence[SignedTransactionAPI], uncles: Sequence[BlockHeaderAPI], withdrawals: Sequence[WithdrawalAPI])
        +get_transaction_builder()
    }
Loading

File-Level Changes

Change Details Files
Adds support for Python 3.13 to the CI configuration.
  • Adds new jobs for py313-native-blockchain-* environments.
  • Adds new jobs for py313-core, py313-database, py313-difficulty, py313-lint, py313-transactions, py313-vm, py313-wheel, and py313-windows-wheel.
  • Includes all py313 jobs in the 'all_jobs' definition.
  • Adds all py313 jobs to the 'test' and 'nightly' workflows.
.circleci/config.yml
Updates the Makefile with new commands and improves existing ones.
  • Adds clean command to remove build artifacts and Python file artifacts.
  • Adds dist command to build the package and list the contents of the dist directory.
  • Adds autobuild-docs command for live updating docs when changes are saved.
  • Adds package-test command to build the package and install it in a venv for manual testing.
  • Modifies the notes command to use bump-my-version and include the version in the commit message.
  • Modifies the release command to include checks for git configuration and newsfragments, and uses bump-my-version.
  • Adds check-bump and check-git helper commands for the release process.
Makefile
Updates the pyproject.toml file with various configuration changes.
  • Adds pytest to force_to_top in isort configuration.
  • Adds honor_noqa and use_parentheses to isort configuration.
  • Updates mypy configuration.
  • Updates towncrier configuration.
  • Updates bumpversion configuration with new versioning scheme and settings.
pyproject.toml
Updates the README.md file to reflect changes in installation and documentation.
  • Updates the installation instructions.
  • Removes the Developer Setup section.
  • Removes the Release setup section.
  • Removes the Want to help section.
  • Updates the documentation link.
  • Adds a link to the changelog.
README.md
Updates the tox.ini file to include Python 3.13 and adjust linting configurations.
  • Adds Python 3.13 to the envlist for various test environments.
  • Adds blocklint configuration.
  • Adds dev extra to testenv:py{38,39,310,311,312,313}-lint.
  • Removes mypy repo from pre-commit-config.yaml and adds a local mypy hook.
  • Adds a blocklint repo to pre-commit-config.yaml.
  • Adds a hook to check for .rst files in the top-level directory.
tox.ini
.pre-commit-config.yaml
Updates type hints and adds casting to improve type safety.
  • Adds type hints to __init__ method in eth/rlp/blocks.py.
  • Adds casting to Address in eth/consensus/clique/_utils.py.
  • Adds casting to Hash32 in eth/precompiles/point_evaluation.py.
eth/rlp/blocks.py
eth/consensus/clique/_utils.py
eth/precompiles/point_evaluation.py
Moves PublicKeyFactory and new_transaction to tests.tools.factories.
  • Moves PublicKeyFactory and new_transaction from eth.tools.factories to tests.tools.factories.
  • Updates imports in tests/core/consensus/test_clique_consensus.py, tests/core/vm/test_vm_state.py, tests/core/vm/test_london.py, and tests/database/test_eth1_chaindb.py.
tests/core/consensus/test_clique_consensus.py
tests/core/vm/test_vm_state.py
tests/core/vm/test_london.py
tests/database/test_eth1_chaindb.py
Updates setup.py to reflect the new version and dependencies.
  • Updates the version number.
  • Adds bump_my_version and mypy to the 'dev' extras.
  • Updates towncrier version in the 'docs' extras.
  • Removes py-evm from the 'docs' extras.
  • Adds Python 3.13 to the classifiers.
setup.py
Updates the usage of f-strings to be more explicit with the representation of objects.
  • Adds !r to f-strings in eth/consensus/clique/snapshot_manager.py, eth/db/schema.py, and eth/db/chain.py.
eth/consensus/clique/snapshot_manager.py
eth/db/schema.py
eth/db/chain.py
Updates documentation build configuration and adds a LaTeX engine.
  • Updates the Python version in .readthedocs.yaml to 3.10.
  • Adds test to the extra requirements in .readthedocs.yaml.
  • Adds latex_engine = "xelatex" to docs/conf.py.
.readthedocs.yaml
docs/conf.py
Removes unused or outdated files.
  • Removes tests/core/test_import.py.
  • Removes FUNDING.json.
  • Removes .bumpversion.cfg.
  • Removes 2184.internal.rst.
  • Removes tests/core/test_import.py.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Dargon789 - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Hardcoded address for BEACON_ROOTS_ADDRESS. (link)

Overall Comments:

  • It looks like you've incremented to Python 3.13 in some places but are still using Python 3.12 in others; please ensure consistency.
  • The bump argument in the Makefile's release target should be validated before being passed to bumpversion.
  • Consider using taskipy instead of make for task management.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Dargon789 Dargon789 merged commit 71dfd30 into Dargon789:main Mar 2, 2025
2 of 3 checks passed
Copy link
Owner Author

@Dargon789 Dargon789 left a comment

Choose a reason for hiding this comment

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

add py312 support #1

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.

7 participants