diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cfc9c2d5..9d031c7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: name: sync pre-commit dependencies - repo: https://github.com/pdm-project/pdm - rev: 2.22.3 + rev: 2.25.9 hooks: - id: pdm-lock-check name: check pdm lock file @@ -72,7 +72,7 @@ repos: name: apply walrus operator - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.3 + rev: v0.14.2 hooks: - id: ruff name: lint code (ruff) @@ -93,8 +93,8 @@ repos: - types-requests - types-setuptools - types-protobuf - - pydantic==2.10.6 - - pytest==8.3.4 + - pydantic==2.12.3 + - pytest==8.4.2 - repo: https://github.com/PyCQA/bandit rev: 1.7.8 diff --git a/pdm.lock b/pdm.lock index b561b6d4..a1104c87 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:2e47bf9c08c35c03580c6e7f3911786fc8aa31ebe06c669c66309e8933b9d631" +content_hash = "sha256:1f6c940c7eb37602493d80bd24cbdb5288394391ff4779d6674c658e74bbf4d4" [[metadata.targets]] requires_python = ">=3.12,<3.13" @@ -616,13 +616,13 @@ files = [ [[package]] name = "lark" -version = "1.3.0" +version = "1.3.1" requires_python = ">=3.8" summary = "a modern parsing library" groups = ["default"] files = [ - {file = "lark-1.3.0-py3-none-any.whl", hash = "sha256:80661f261fb2584a9828a097a2432efd575af27d20be0fd35d17f0fe37253831"}, - {file = "lark-1.3.0.tar.gz", hash = "sha256:9a3839d0ca5e1faf7cfa3460e420e859b66bcbde05b634e73c369c8244c5fa48"}, + {file = "lark-1.3.1-py3-none-any.whl", hash = "sha256:c629b661023a014c37da873b4ff58a817398d12635d3bbb2c5a03be7fe5d1e12"}, + {file = "lark-1.3.1.tar.gz", hash = "sha256:b426a7a6d6d53189d318f2b6236ab5d6429eaf09259f1ca33eb716eed10d2905"}, ] [[package]] @@ -1284,30 +1284,30 @@ files = [ [[package]] name = "ruff" -version = "0.14.1" +version = "0.14.2" requires_python = ">=3.7" summary = "An extremely fast Python linter and code formatter, written in Rust." groups = ["dev"] files = [ - {file = "ruff-0.14.1-py3-none-linux_armv6l.whl", hash = "sha256:083bfc1f30f4a391ae09c6f4f99d83074416b471775b59288956f5bc18e82f8b"}, - {file = "ruff-0.14.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:f6fa757cd717f791009f7669fefb09121cc5f7d9bd0ef211371fad68c2b8b224"}, - {file = "ruff-0.14.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d6191903d39ac156921398e9c86b7354d15e3c93772e7dbf26c9fcae59ceccd5"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed04f0e04f7a4587244e5c9d7df50e6b5bf2705d75059f409a6421c593a35896"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5c9e6cf6cd4acae0febbce29497accd3632fe2025c0c583c8b87e8dbdeae5f61"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a6fa2458527794ecdfbe45f654e42c61f2503a230545a91af839653a0a93dbc6"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:39f1c392244e338b21d42ab29b8a6392a722c5090032eb49bb4d6defcdb34345"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7382fa12a26cce1f95070ce450946bec357727aaa428983036362579eadcc5cf"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd0bf2be3ae8521e1093a487c4aa3b455882f139787770698530d28ed3fbb37c"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cabcaa9ccf8089fb4fdb78d17cc0e28241520f50f4c2e88cb6261ed083d85151"}, - {file = "ruff-0.14.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:747d583400f6125ec11a4c14d1c8474bf75d8b419ad22a111a537ec1a952d192"}, - {file = "ruff-0.14.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:5a6e74c0efd78515a1d13acbfe6c90f0f5bd822aa56b4a6d43a9ffb2ae6e56cd"}, - {file = "ruff-0.14.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0ea6a864d2fb41a4b6d5b456ed164302a0d96f4daac630aeba829abfb059d020"}, - {file = "ruff-0.14.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0826b8764f94229604fa255918d1cc45e583e38c21c203248b0bfc9a0e930be5"}, - {file = "ruff-0.14.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:cbc52160465913a1a3f424c81c62ac8096b6a491468e7d872cb9444a860bc33d"}, - {file = "ruff-0.14.1-py3-none-win32.whl", hash = "sha256:e037ea374aaaff4103240ae79168c0945ae3d5ae8db190603de3b4012bd1def6"}, - {file = "ruff-0.14.1-py3-none-win_amd64.whl", hash = "sha256:59d599cdff9c7f925a017f6f2c256c908b094e55967f93f2821b1439928746a1"}, - {file = "ruff-0.14.1-py3-none-win_arm64.whl", hash = "sha256:e3b443c4c9f16ae850906b8d0a707b2a4c16f8d2f0a7fe65c475c5886665ce44"}, - {file = "ruff-0.14.1.tar.gz", hash = "sha256:1dd86253060c4772867c61791588627320abcb6ed1577a90ef432ee319729b69"}, + {file = "ruff-0.14.2-py3-none-linux_armv6l.whl", hash = "sha256:7cbe4e593505bdec5884c2d0a4d791a90301bc23e49a6b1eb642dd85ef9c64f1"}, + {file = "ruff-0.14.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8d54b561729cee92f8d89c316ad7a3f9705533f5903b042399b6ae0ddfc62e11"}, + {file = "ruff-0.14.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5c8753dfa44ebb2cde10ce5b4d2ef55a41fb9d9b16732a2c5df64620dbda44a3"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d0bbeffb8d9f4fccf7b5198d566d0bad99a9cb622f1fc3467af96cb8773c9e3"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7047f0c5a713a401e43a88d36843d9c83a19c584e63d664474675620aaa634a8"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bf8d2f9aa1602599217d82e8e0af7fd33e5878c4d98f37906b7c93f46f9a839"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:1c505b389e19c57a317cf4b42db824e2fca96ffb3d86766c1c9f8b96d32048a7"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a307fc45ebd887b3f26b36d9326bb70bf69b01561950cdcc6c0bdf7bb8e0f7cc"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:61ae91a32c853172f832c2f40bd05fd69f491db7289fb85a9b941ebdd549781a"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1967e40286f63ee23c615e8e7e98098dedc7301568bd88991f6e544d8ae096"}, + {file = "ruff-0.14.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:2877f02119cdebf52a632d743a2e302dea422bfae152ebe2f193d3285a3a65df"}, + {file = "ruff-0.14.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e681c5bc777de5af898decdcb6ba3321d0d466f4cb43c3e7cc2c3b4e7b843a05"}, + {file = "ruff-0.14.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e21be42d72e224736f0c992cdb9959a2fa53c7e943b97ef5d081e13170e3ffc5"}, + {file = "ruff-0.14.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b8264016f6f209fac16262882dbebf3f8be1629777cf0f37e7aff071b3e9b92e"}, + {file = "ruff-0.14.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5ca36b4cb4db3067a3b24444463ceea5565ea78b95fe9a07ca7cb7fd16948770"}, + {file = "ruff-0.14.2-py3-none-win32.whl", hash = "sha256:41775927d287685e08f48d8eb3f765625ab0b7042cc9377e20e64f4eb0056ee9"}, + {file = "ruff-0.14.2-py3-none-win_amd64.whl", hash = "sha256:0df3424aa5c3c08b34ed8ce099df1021e3adaca6e90229273496b839e5a7e1af"}, + {file = "ruff-0.14.2-py3-none-win_arm64.whl", hash = "sha256:ea9d635e83ba21569fbacda7e78afbfeb94911c9434aff06192d9bc23fd5495a"}, + {file = "ruff-0.14.2.tar.gz", hash = "sha256:98da787668f239313d9c902ca7c523fe11b8ec3f39345553a51b25abc4629c96"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index fa357d37..12fe59a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ dependencies = [ # pinned dependencies "httpx==0.27.2", # regression in 0.28, client.get(url, params) looses params directly in URL + "hishel==0.1.1", # too many breaking changes in recent versions # unpinned dependencies "pydantic>=2.8.2", "eip712-clearsign>=4.1.0", @@ -33,7 +34,6 @@ dependencies = [ "lark>=1.2.2", "pydantic-string-url>=1.0.2", "httpx-file>=0.2.0", - "hishel>=0.0.33", "xdg-base-dirs>=6.0.2", "limiter>=0.5.0", "eth-abi>=5.1.0", diff --git a/src/erc7730/common/client.py b/src/erc7730/common/client.py index 49f572ef..c6eb6137 100644 --- a/src/erc7730/common/client.py +++ b/src/erc7730/common/client.py @@ -17,6 +17,8 @@ from erc7730.model.base import Model from erc7730.model.types import Address +# ruff: noqa: UP047 + ETHERSCAN = "api.etherscan.io" _T = TypeVar("_T") diff --git a/src/erc7730/common/options.py b/src/erc7730/common/options.py index 8676eed2..ca5c12d4 100644 --- a/src/erc7730/common/options.py +++ b/src/erc7730/common/options.py @@ -1,5 +1,7 @@ from typing_extensions import TypeVar +# ruff: noqa: UP047 + _T = TypeVar("_T") diff --git a/src/erc7730/common/pydantic.py b/src/erc7730/common/pydantic.py index ca177563..f12ebabd 100644 --- a/src/erc7730/common/pydantic.py +++ b/src/erc7730/common/pydantic.py @@ -11,6 +11,8 @@ from erc7730.common.json import dict_to_json_file, dict_to_json_str, read_json_with_includes +# ruff: noqa: UP047 + _BaseModel = TypeVar("_BaseModel", bound=BaseModel) diff --git a/src/erc7730/convert/__init__.py b/src/erc7730/convert/__init__.py index 3f97f43c..f6989993 100644 --- a/src/erc7730/convert/__init__.py +++ b/src/erc7730/convert/__init__.py @@ -5,6 +5,8 @@ from erc7730.common.output import OutputAdder +# ruff: noqa: UP046 + InputType = TypeVar("InputType", bound=BaseModel) OutputType = TypeVar("OutputType", bound=BaseModel) diff --git a/src/erc7730/lint/classifier/__init__.py b/src/erc7730/lint/classifier/__init__.py index 404052c9..19c6bac2 100644 --- a/src/erc7730/lint/classifier/__init__.py +++ b/src/erc7730/lint/classifier/__init__.py @@ -5,6 +5,8 @@ from erc7730.model.abi import ABI from erc7730.model.context import EIP712Schema +# ruff: noqa: UP046 + class TxClass(StrEnum): STAKE = auto() diff --git a/src/erc7730/model/display.py b/src/erc7730/model/display.py index 2c12753c..9b723226 100644 --- a/src/erc7730/model/display.py +++ b/src/erc7730/model/display.py @@ -6,8 +6,6 @@ from erc7730.model.base import Model from erc7730.model.types import Id -# ruff: noqa: N815 - camel case field names are tolerated to match schema - class FieldFormat(str, Enum): """ diff --git a/src/erc7730/model/input/descriptor.py b/src/erc7730/model/input/descriptor.py index 71cdec19..d4a201fc 100644 --- a/src/erc7730/model/input/descriptor.py +++ b/src/erc7730/model/input/descriptor.py @@ -18,8 +18,6 @@ from erc7730.model.input.display import InputDisplay from erc7730.model.input.metadata import InputMetadata -# ruff: noqa: N815 - camel case field names are tolerated to match schema - class InputERC7730Descriptor(Model): """ diff --git a/src/erc7730/model/input/metadata.py b/src/erc7730/model/input/metadata.py index adc5d2ea..94ceb20a 100644 --- a/src/erc7730/model/input/metadata.py +++ b/src/erc7730/model/input/metadata.py @@ -12,8 +12,6 @@ from erc7730.model.resolved.metadata import EnumDefinition from erc7730.model.types import Id, ScalarType -# ruff: noqa: N815 - camel case field names are tolerated to match schema - class InputMetadata(Metadata): """ diff --git a/src/erc7730/model/resolved/descriptor.py b/src/erc7730/model/resolved/descriptor.py index 44ac9e06..f48c1218 100644 --- a/src/erc7730/model/resolved/descriptor.py +++ b/src/erc7730/model/resolved/descriptor.py @@ -18,8 +18,6 @@ from erc7730.model.resolved.display import ResolvedDisplay from erc7730.model.resolved.metadata import ResolvedMetadata -# ruff: noqa: N815 - camel case field names are tolerated to match schema - class ResolvedERC7730Descriptor(Model): """ diff --git a/src/erc7730/model/resolved/metadata.py b/src/erc7730/model/resolved/metadata.py index 3ecab446..548f0263 100644 --- a/src/erc7730/model/resolved/metadata.py +++ b/src/erc7730/model/resolved/metadata.py @@ -10,8 +10,6 @@ from erc7730.model.metadata import EnumDefinition, Metadata from erc7730.model.types import Id -# ruff: noqa: N815 - camel case field names are tolerated to match schema - class ResolvedMetadata(Metadata): """