Skip to content

Commit 11182f7

Browse files
committed
fix: 修复 CI 测试模块导入问题
- 恢复使用 editable 安装 (pip install -e .[dev]) - 添加 pythonpath 配置到 pyproject.toml - 修复 hatch build 配置
1 parent 6f3a5f2 commit 11182f7

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install dependencies
3535
run: |
3636
python -m pip install --upgrade pip
37-
pip install .[dev]
37+
pip install -e .[dev]
3838
3939
- name: Lint with Ruff
4040
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install .[dev]
23+
pip install -e .[dev]
2424
- name: Run tests
2525
run: pytest
2626

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ requires = ["hatchling>=1.14.0"]
3333
build-backend = "hatchling.build"
3434

3535
[tool.hatch.build.targets.wheel]
36-
include = ["mcp_documents_reader.py"]
36+
packages = ["."]
3737

3838
[tool.ruff]
3939
line-length = 88
@@ -45,6 +45,7 @@ select = ["E", "F", "I", "ARG"]
4545
"mcp_documents_reader.py" = ["ARG001"]
4646

4747
[tool.pytest.ini_options]
48+
pythonpath = ["."]
4849
testpaths = ["tests"]
4950
addopts = "-v --cov=mcp_documents_reader --cov-report=term-missing --cov-fail-under=90"
5051
asyncio_mode = "auto"

0 commit comments

Comments
 (0)