From b24bc5d4bb9aecf03f00ed0d3fcf9788709f76fd Mon Sep 17 00:00:00 2001 From: NotPeopling2day <32708219+NotPeopling2day@users.noreply.github.com> Date: Mon, 18 Dec 2023 18:54:08 -0500 Subject: [PATCH] feat!: Handle 0.7 breaking changes and updates [APE-1567] (#23) --- .mdformat.toml | 1 - .pre-commit-config.yaml | 4 ++-- pyproject.toml | 4 ++++ setup.py | 14 +++++++++----- tests/test_ecosystem.py | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) delete mode 100644 .mdformat.toml diff --git a/.mdformat.toml b/.mdformat.toml deleted file mode 100644 index 01b2fb0..0000000 --- a/.mdformat.toml +++ /dev/null @@ -1 +0,0 @@ -number = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b82e384..e15dfcf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: isort - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.12.0 hooks: - id: black name: black @@ -21,7 +21,7 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.1 hooks: - id: mypy additional_dependencies: [types-setuptools, pydantic] diff --git a/pyproject.toml b/pyproject.toml index 9068ef4..e560c90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = ["setuptools>=51.1.1", "wheel", "setuptools_scm[toml]>=5.0,<8"] [tool.mypy] exclude = "build/" +plugins = ["pydantic.mypy"] [tool.setuptools_scm] write_to = "ape_polygon/version.py" @@ -36,3 +37,6 @@ force_grid_wrap = 0 include_trailing_comma = true multi_line_output = 3 use_parentheses = true + +[tool.mdformat] +number = true diff --git a/setup.py b/setup.py index 2fbdf6f..3716e51 100644 --- a/setup.py +++ b/setup.py @@ -5,19 +5,22 @@ extras_require = { "test": [ # `test` GitHub Action jobs uses this "pytest>=6.0", # Core testing package - "pytest-xdist", # multi-process runner + "pytest-xdist", # Multi-process runner "pytest-cov", # Coverage analyzer plugin "hypothesis>=6.2.0,<7", # Strategy-based fuzzer ], "lint": [ - "black>=23.10.1,<24", # Auto-formatter and linter - "mypy>=1.6.1,<2", # Static type analyzer - "types-setuptools", # Needed due to mypy typeshed + "black>=23.12.0,<24", # Auto-formatter and linter + "mypy>=1.7.1,<2", # Static type analyzer + "types-setuptools", # Needed for mypy type shed "flake8>=6.1.0,<7", # 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 "isort>=5.10.1,<6", # Import sorting linter "mdformat>=0.7.17", # 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 ], "release": [ # `release` GitHub Action job uses this "setuptools", # Installation tool @@ -57,7 +60,8 @@ url="https://github.com/ApeWorX/ape-polygon", include_package_data=True, install_requires=[ - "eth-ape>=0.6.0,<0.7", + "eth-ape>=0.7.0,<0.8", + "ethpm-types", # Use same version as eth-ape ], python_requires=">=3.8,<4", extras_require=extras_require, diff --git a/tests/test_ecosystem.py b/tests/test_ecosystem.py index b923aad..1500ad0 100644 --- a/tests/test_ecosystem.py +++ b/tests/test_ecosystem.py @@ -23,7 +23,7 @@ def test_create_transaction(polygon, tx_type, eth_tester_provider): ), ) def test_encode_transaction(tx_type, polygon, eth_tester_provider): - abi = MethodABI.parse_obj( + abi = MethodABI.model_validate( { "type": "function", "name": "fooAndBar",