@@ -36,19 +36,35 @@ install:
3636
3737# Run all tests
3838test :
39- PYTHONPATH=src python3 -m pytest tests/ -v
39+ @if command -v uv > /dev/null 2>&1 ; then \
40+ PYTHONPATH=src uv run pytest tests/ -v; \
41+ else \
42+ PYTHONPATH=src python3 -m pytest tests/ -v; \
43+ fi
4044
4145# Run unit tests only
4246test-unit :
43- PYTHONPATH=src python3 -m pytest tests/unit/ -v
47+ @if command -v uv > /dev/null 2>&1 ; then \
48+ PYTHONPATH=src uv run pytest tests/unit/ -v; \
49+ else \
50+ PYTHONPATH=src python3 -m pytest tests/unit/ -v; \
51+ fi
4452
4553# Run integration tests only
4654test-integration :
47- PYTHONPATH=src python3 -m pytest tests/integration/ -v
55+ @if command -v uv > /dev/null 2>&1 ; then \
56+ PYTHONPATH=src uv run pytest tests/integration/ -v; \
57+ else \
58+ PYTHONPATH=src python3 -m pytest tests/integration/ -v; \
59+ fi
4860
4961# Run tests with coverage
5062test-coverage :
51- PYTHONPATH=src python3 -m pytest tests/ --cov=cli_patterns --cov-report=term-missing --cov-report=html
63+ @if command -v uv > /dev/null 2>&1 ; then \
64+ PYTHONPATH=src uv run pytest tests/ --cov=cli_patterns --cov-report=term-missing --cov-report=html; \
65+ else \
66+ PYTHONPATH=src python3 -m pytest tests/ --cov=cli_patterns --cov-report=term-missing --cov-report=html; \
67+ fi
5268
5369# Run specific test file
5470test-file :
6581
6682# Type check with mypy
6783type-check :
68- PYTHONPATH=src python3 -m mypy src/cli_patterns --strict
84+ @if command -v uv > /dev/null 2>&1 ; then \
85+ PYTHONPATH=src uv run mypy src/cli_patterns --strict; \
86+ else \
87+ PYTHONPATH=src python3 -m mypy src/cli_patterns --strict; \
88+ fi
6989
7090# Format code
7191format :
@@ -94,11 +114,19 @@ all: format lint type-check test
94114
95115# Quick test for current work
96116quick :
97- PYTHONPATH=src python3 -m pytest tests/unit/ui/design/ -v
117+ @if command -v uv > /dev/null 2>&1 ; then \
118+ PYTHONPATH=src uv run pytest tests/unit/ui/design/ -v; \
119+ else \
120+ PYTHONPATH=src python3 -m pytest tests/unit/ui/design/ -v; \
121+ fi
98122
99123# Watch tests (requires pytest-watch)
100124watch :
101- PYTHONPATH=src python3 -m pytest-watch tests/ --clear
125+ @if command -v uv > /dev/null 2>&1 ; then \
126+ PYTHONPATH=src uv run pytest-watch tests/ --clear; \
127+ else \
128+ PYTHONPATH=src python3 -m pytest-watch tests/ --clear; \
129+ fi
102130
103131# Run pre-commit hooks
104132pre-commit :
@@ -110,16 +138,32 @@ pre-commit-install:
110138
111139# Run tests by marker
112140test-parser :
113- PYTHONPATH=src python3 -m pytest tests/ -m parser -v
141+ @if command -v uv > /dev/null 2>&1 ; then \
142+ PYTHONPATH=src uv run pytest tests/ -m parser -v; \
143+ else \
144+ PYTHONPATH=src python3 -m pytest tests/ -m parser -v; \
145+ fi
114146
115147test-executor :
116- PYTHONPATH=src python3 -m pytest tests/ -m executor -v
148+ @if command -v uv > /dev/null 2>&1 ; then \
149+ PYTHONPATH=src uv run pytest tests/ -m executor -v; \
150+ else \
151+ PYTHONPATH=src python3 -m pytest tests/ -m executor -v; \
152+ fi
117153
118154test-design :
119- PYTHONPATH=src python3 -m pytest tests/ -m design -v
155+ @if command -v uv > /dev/null 2>&1 ; then \
156+ PYTHONPATH=src uv run pytest tests/ -m design -v; \
157+ else \
158+ PYTHONPATH=src python3 -m pytest tests/ -m design -v; \
159+ fi
120160
121161test-fast :
122- PYTHONPATH=src python3 -m pytest tests/ -m " not slow" -v
162+ @if command -v uv > /dev/null 2>&1 ; then \
163+ PYTHONPATH=src uv run pytest tests/ -m " not slow" -v; \
164+ else \
165+ PYTHONPATH=src python3 -m pytest tests/ -m " not slow" -v; \
166+ fi
123167
124168test-components :
125169 PYTHONPATH=src python3 -m pytest tests/ -m " parser or executor or design" -v
0 commit comments