Skip to content

Commit 423ccbd

Browse files
committed
chore(ci): update GitHub Actions workflow to use uv for running tests and linting tools
feat(pyproject.toml): add development dependencies for ruff, black, isort, mypy, and pre-commit to enhance code quality tools
1 parent 5ffc403 commit 423ccbd

File tree

3 files changed

+286
-10
lines changed

3 files changed

+286
-10
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: Test
23

34
on:
@@ -21,23 +22,28 @@ jobs:
2122
with:
2223
python-version: ${{ matrix.python-version }}
2324

24-
- name: Install dependencies
25+
- name: Install uv
2526
run: |
2627
python -m pip install --upgrade pip
27-
pip install -e ".[test,dev]"
28+
pip install uv
2829
2930
- name: Run tests
3031
run: |
31-
pytest
32+
uv run pytest
3233
3334
- name: Run ruff
3435
run: |
35-
ruff check .
36+
uv run ruff .
3637
3738
- name: Run black
3839
run: |
39-
black . --check
40+
uv run black . --check
41+
42+
- name: Run isort
43+
run: |
44+
uv run isort . --check-only
4045
4146
- name: Run mypy
4247
run: |
43-
mypy mcp_shell_server tests
48+
uv run mypy mcp_shell_server tests
49+

pyproject.toml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
[project]
23
name = "mcp-shell-server"
34
version = "0.1.0"
@@ -18,9 +19,16 @@ mcp-shell-server = "mcp_shell_server.server:main"
1819
[project.optional-dependencies]
1920
test = [
2021
"pytest>=7.4.0",
21-
"pytest-asyncio>=0.23.0",
22+
"pytest-asyncio>=0.23.0",
2223
"pytest-env>=1.1.0",
2324
]
25+
dev = [
26+
"ruff>=0.0.262",
27+
"black>=23.3.0",
28+
"isort>=5.12.0",
29+
"mypy>=1.2.0",
30+
"pre-commit>=3.2.2",
31+
]
2432

2533
[build-system]
2634
requires = ["hatchling"]
@@ -29,5 +37,28 @@ build-backend = "hatchling.build"
2937
[tool.pytest.ini_options]
3038
asyncio_mode = "strict"
3139
testpaths = "tests"
32-
# Set default event loop scope for async tests
33-
asyncio_default_fixture_loop_scope = "function"
40+
# Set default event loop scope for async tests
41+
asyncio_default_fixture_loop_scope = "function"
42+
43+
[tool.ruff]
44+
select = [
45+
"E", # pycodestyle errors
46+
"F", # pyflakes
47+
"W", # pycodestyle warnings
48+
"I", # isort
49+
"C", # flake8-comprehensions
50+
"B", # flake8-bugbear
51+
]
52+
ignore = [
53+
"E501", # line too long, handled by black
54+
"B008", # do not perform function calls in argument defaults
55+
"C901", # too complex
56+
]
57+
58+
[tool.black]
59+
line-length = 88
60+
target-version = ['py311']
61+
62+
[tool.isort]
63+
profile = "black"
64+
line_length = 88

0 commit comments

Comments
 (0)