From f0a2c5be1976735d0d811223e561397b5b68ff97 Mon Sep 17 00:00:00 2001 From: Stanislav Khrapov Date: Wed, 1 Jul 2026 22:03:50 +0200 Subject: [PATCH 1/4] remove mypy --- .pre-commit-config.yaml | 6 ------ pyproject.toml | 6 ------ src/order_matching/matching_engine.py | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bafab5d..ae95daa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,12 +22,6 @@ repos: args: [ --config, pyproject.toml ] types_or: [ python ] - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.1.0 - hooks: - - id: mypy - args: [--config, pyproject.toml] - - repo: https://github.com/astral-sh/ty-pre-commit rev: v0.0.55 hooks: diff --git a/pyproject.toml b/pyproject.toml index de83b7e..fed273e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,12 +77,6 @@ ignore = [ [tool.ruff.lint.pydocstyle] convention = "numpy" -[tool.mypy] -ignore_missing_imports = true -disallow_untyped_calls = true -disallow_untyped_defs = true -disallow_incomplete_defs = true - [tool.ty.rules] no-matching-overload = "ignore" diff --git a/src/order_matching/matching_engine.py b/src/order_matching/matching_engine.py index f9104ae..1519ac7 100644 --- a/src/order_matching/matching_engine.py +++ b/src/order_matching/matching_engine.py @@ -41,14 +41,14 @@ class MatchingEngine: timestamp=datetime.datetime(2023, 1, 2, 0, 0))] """ - def __init__(self, seed: int | None = None) -> None: + def __init__(self, seed: int | None = None): self._seed = seed self._faker = get_faker(seed=seed) self._queue = Orders() self.unprocessed_orders = OrderBook() self._timestamp: datetime | None = None - def match(self, timestamp: datetime, orders: Orders | None = None) -> ExecutedTrades: + def match(self, timestamp, orders: Orders | None = None) -> ExecutedTrades: """Match incoming orders in price-time priority. Parameters From 408646df8fad9ae18b75a54913ec40b2437b379b Mon Sep 17 00:00:00 2001 From: Stanislav Khrapov Date: Wed, 1 Jul 2026 22:06:04 +0200 Subject: [PATCH 2/4] return mypy --- .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae95daa..bafab5d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,12 @@ repos: args: [ --config, pyproject.toml ] types_or: [ python ] + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v2.1.0 + hooks: + - id: mypy + args: [--config, pyproject.toml] + - repo: https://github.com/astral-sh/ty-pre-commit rev: v0.0.55 hooks: diff --git a/pyproject.toml b/pyproject.toml index fed273e..de83b7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,12 @@ ignore = [ [tool.ruff.lint.pydocstyle] convention = "numpy" +[tool.mypy] +ignore_missing_imports = true +disallow_untyped_calls = true +disallow_untyped_defs = true +disallow_incomplete_defs = true + [tool.ty.rules] no-matching-overload = "ignore" From 5475632a0dccc524af69a559b35bb126e2b907d1 Mon Sep 17 00:00:00 2001 From: Stanislav Khrapov Date: Wed, 1 Jul 2026 22:09:52 +0200 Subject: [PATCH 3/4] remove mypy --- .pre-commit-config.yaml | 6 ------ pyproject.toml | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bafab5d..ae95daa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,12 +22,6 @@ repos: args: [ --config, pyproject.toml ] types_or: [ python ] - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.1.0 - hooks: - - id: mypy - args: [--config, pyproject.toml] - - repo: https://github.com/astral-sh/ty-pre-commit rev: v0.0.55 hooks: diff --git a/pyproject.toml b/pyproject.toml index de83b7e..8e2e29e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ line-length = 120 src = ["src", "tests"] [tool.ruff.lint] -select = ["E", "F", "D", "B", "I", "ARG"] +select = ["E", "F", "D", "B", "I", "ARG", "ANN"] ignore = [ "D100", "D101", @@ -77,12 +77,6 @@ ignore = [ [tool.ruff.lint.pydocstyle] convention = "numpy" -[tool.mypy] -ignore_missing_imports = true -disallow_untyped_calls = true -disallow_untyped_defs = true -disallow_incomplete_defs = true - [tool.ty.rules] no-matching-overload = "ignore" From 689326e56a0a73542d7ff26842422c6391cdf42a Mon Sep 17 00:00:00 2001 From: Stanislav Khrapov Date: Wed, 1 Jul 2026 22:11:05 +0200 Subject: [PATCH 4/4] remove mypy --- src/order_matching/matching_engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/order_matching/matching_engine.py b/src/order_matching/matching_engine.py index 1519ac7..f9104ae 100644 --- a/src/order_matching/matching_engine.py +++ b/src/order_matching/matching_engine.py @@ -41,14 +41,14 @@ class MatchingEngine: timestamp=datetime.datetime(2023, 1, 2, 0, 0))] """ - def __init__(self, seed: int | None = None): + def __init__(self, seed: int | None = None) -> None: self._seed = seed self._faker = get_faker(seed=seed) self._queue = Orders() self.unprocessed_orders = OrderBook() self._timestamp: datetime | None = None - def match(self, timestamp, orders: Orders | None = None) -> ExecutedTrades: + def match(self, timestamp: datetime, orders: Orders | None = None) -> ExecutedTrades: """Match incoming orders in price-time priority. Parameters