Skip to content

Commit 498ed6e

Browse files
committed
Refactor: Update Makefile for pytest and coverage
- Changed default Python to python3. - Updated PIP to use `$(PYTHON) -m pip`. - Introduced PYTEST_ARGS for flexible pytest execution. - Added a new `coverage` target for generating XML and term-missing coverage reports. - Added `coverage` to the .PHONY targets.
1 parent 4b4c86d commit 498ed6e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ VENV_BIN := $(VENV)/bin
77
VENV_ACTIVATE := source $(VENV_BIN)/activate
88
DEFAULT_PYTHON := $(if $(wildcard $(VENV_BIN)/python),$(VENV_BIN)/python,)
99

10-
PYTHON ?= $(if $(DEFAULT_PYTHON),$(DEFAULT_PYTHON),$(UVX) python)
11-
PIP ?= $(if $(DEFAULT_PYTHON),$(VENV_BIN)/pip,$(UVX) pip)
10+
PYTHON ?= $(if $(DEFAULT_PYTHON),$(DEFAULT_PYTHON),python3)
11+
PIP ?= $(PYTHON) -m pip
1212
RUFF ?= $(UVX) ruff
13-
PYTEST ?= pytest -vv --cov=simple_agent --cov-report=term-missing
13+
PYTEST ?= $(PYTHON) -m pytest
14+
PYTEST_ARGS ?= -vv --cov=simple_agent --cov-report=term-missing
1415

15-
.PHONY: venv run lint tools install clean test
16+
.PHONY: venv run lint tools install clean test coverage
1617

1718
venv:
1819
$(VENV_PYTHON) -m venv $(VENV)
@@ -28,7 +29,10 @@ tools:
2829
$(PYTHON) main.py --list-tools
2930

3031
test:
31-
$(PYTEST)
32+
$(PYTEST) $(PYTEST_ARGS)
33+
34+
coverage:
35+
$(PYTEST) --cov-report=xml --cov-report=term-missing --cov=simple_agent
3236

3337
lint:
3438
$(RUFF) check simple_agent main.py

0 commit comments

Comments
 (0)