Skip to content

Commit

Permalink
chore: templating
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 10, 2024
1 parent 0d6958a commit b48f7c4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml

Expand All @@ -10,7 +10,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
name: black
Expand All @@ -21,13 +21,13 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [types-PyYAML, types-requests, types-setuptools, pydantic]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.19
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-frontmatter]
Expand Down
7 changes: 4 additions & 3 deletions evm_trace/gas.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import copy
from typing import TypeVar
from typing import TYPE_CHECKING, TypeVar

from evm_trace.base import CallTreeNode
if TYPE_CHECKING:
from evm_trace.base import CallTreeNode

ContractID = TypeVar("ContractID")
MethodID = TypeVar("MethodID")
GasReport = dict[ContractID, dict[MethodID, list[int]]]


def get_gas_report(calltree: CallTreeNode) -> GasReport:
def get_gas_report(calltree: "CallTreeNode") -> GasReport:
"""
Extracts a gas report object from a :class:`~evm_trace.base.CallTreeNode`.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ write_to = "evm_trace/version.py"

[tool.black]
line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'

[tool.pytest.ini_options]
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ exclude =
docs
build
evm_trace/version.py
ignore = E704,W503,PYD002
ignore = E704,W503,PYD002,TC003,TC006
per-file-ignores =
# The traces have to be formatted this way for the tests.
tests/expected_traces.py: E501
type-checking-pydantic-enabled = True
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@
"eth-hash[pysha3]", # For eth-utils address checksumming
],
"lint": [
"black>=24.8.0,<25", # Auto-formatter and linter
"mypy>=1.11.1,<2", # Static type analyzer
"black>=24.10.0,<25", # Auto-formatter and linter
"mypy>=1.13.0,<2", # Static type analyzer
"types-setuptools", # Needed for mypy type shed
"flake8>=7.1.1,<8", # Style linter
"flake8-breakpoint>=1.1.0,<2", # Detect breakpoints left in code
"flake8-print>=5.0.0,<6", # Detect print statements left in code
"flake8-print>=4.0.1,<5", # Detect print statements left in code
"flake8-pydantic", # For detecting issues with Pydantic models
"flake8-type-checking", # Detect imports to move in/out of type-checking blocks
"isort>=5.10.1,<6", # Import sorting linter
"mdformat>=0.7.17", # Auto-formatter for markdown
"mdformat>=0.7.19", # Auto-formatter for markdown
"mdformat-gfm>=0.3.5", # Needed for formatting GitHub-flavored markdown
"mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates
"mdformat-pyproject>=0.0.1", # Allows configuring in pyproject.toml
"mdformat-pyproject>=0.0.2", # Allows configuring in pyproject.toml
],
"release": [ # `release` GitHub Action job uses this
"setuptools>=75.6.0", # Installation tool
Expand Down

0 comments on commit b48f7c4

Please sign in to comment.