Skip to content

Commit c065900

Browse files
committed
chore: add mypy for advanced type checks
1 parent 44b09ec commit c065900

File tree

3 files changed

+76
-5
lines changed

3 files changed

+76
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ jobs:
3434
env:
3535
SKIP: no-commit-to-branch
3636

37+
mypy:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: astral-sh/setup-uv@v3
43+
with:
44+
enable-cache: true
45+
46+
- name: Install dependencies
47+
run: uv sync --python 3.11 --frozen --all-extras --all-packages
48+
49+
- name: Run mypy
50+
run: uv run --frozen mypy --python-version 3.11 src
51+
3752
test:
3853
name: test on ${{ matrix.python-version }}
3954
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ classifiers = [
2626
]
2727
version = "0.2.2"
2828
requires-python = ">=3.11"
29-
dependencies = [
30-
"mcp",
31-
"uvicorn>=0.34.0",
32-
]
29+
dependencies = ["mcp", "uvicorn>=0.34.0"]
3330

3431
[build-system]
3532
requires = ["setuptools"]
@@ -43,6 +40,7 @@ Changelog = "https://github.com/sparfenyuk/mcp-proxy/releases"
4340

4441
[project.scripts]
4542
mcp-proxy = "mcp_proxy.__main__:main"
43+
mcp-reverse-proxy = "mcp_proxy.__main__:client"
4644

4745
[tool.setuptools.package-data]
4846
"*" = ["py.typed"]
@@ -52,6 +50,7 @@ dev-dependencies = [
5250
"pytest>=8.3.3",
5351
"pytest-asyncio>=0.25.0",
5452
"coverage>=7.6.0",
53+
"mypy>=1.0.0",
5554
]
5655

5756
[tool.coverage.run]
@@ -74,6 +73,21 @@ exclude_lines = [
7473
'if __name__ == .__main__.:',
7574
]
7675

76+
[tool.mypy]
77+
allow_redefinition = false
78+
disallow_untyped_defs = true
79+
follow_imports = "normal"
80+
follow_untyped_imports = true
81+
no_implicit_optional = true
82+
show_error_code_links = true
83+
show_error_codes = true
84+
strict = true
85+
warn_redundant_casts = true
86+
warn_return_any = true
87+
warn_unreachable = true
88+
warn_unused_configs = true
89+
warn_unused_ignores = true
90+
7791
[tool.ruff.lint]
7892
select = ["ALL"]
7993
ignore = [

uv.lock

Lines changed: 43 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)