Skip to content

Commit 320e67b

Browse files
committed
Fix test setup and dev dependency configuration
1 parent 6910f3e commit 320e67b

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
with:
1616
python-version: "3.13"
1717
- name: Install dependencies
18-
run: uv sync --dev
18+
run: uv sync --extra dev
1919
- name: Run tests
20-
run: uv run --dev pytest
20+
run: uv run --extra dev pytest

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Create/refresh a local .venv and install deps from pyproject/uv.lock
44
install:
5-
uv sync --dev
5+
uv sync --extra dev
66

77
# Optional: create venv explicitly (uv sync will also create one if missing)
88
venv:
@@ -13,15 +13,15 @@ ingest:
1313
uv run ingest.py
1414

1515
chat:
16-
uv run chat.py
16+
uv run chat.py
1717

1818
# Run the automated test suite
1919
test:
20-
uv run --dev pytest
20+
uv run --extra dev pytest
2121

2222
# Create/update a lockfile explicitly (optional; uv sync also updates it)
2323
lock:
24-
uv lock
24+
uv lock
2525

2626
clean:
2727
rm -rf .rag

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ dependencies = [
1313
"pyyaml>=6.0.3",
1414
]
1515

16-
[tool.uv]
17-
dev-dependencies = [
16+
[project.optional-dependencies]
17+
dev = [
1818
"pytest>=8.3.3",
1919
]
2020

tests/test_ingest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,20 @@ def ingest_module():
3636
)
3737
created = True
3838

39+
added_to_path = False
40+
if str(project_root) not in sys.path:
41+
sys.path.insert(0, str(project_root))
42+
added_to_path = True
43+
3944
try:
4045
if "ingest" in sys.modules:
4146
module = sys.modules["ingest"]
4247
else:
4348
module = importlib.import_module("ingest")
4449
yield module
4550
finally:
51+
if added_to_path and str(project_root) in sys.path:
52+
sys.path.remove(str(project_root))
4653
if created and config_path.exists():
4754
config_path.unlink()
4855

0 commit comments

Comments
 (0)