Skip to content

Commit 990f83a

Browse files
committed
Fix makefile for Marcelo
1 parent b8c3ae6 commit 990f83a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ lint: ## Lint the code
3434
uv run ruff format --check
3535
uv run ruff check
3636

37-
PYRIGHT_PYTHON ?= 3.12
3837
.PHONY: typecheck-pyright
3938
typecheck-pyright:
39+
@# To typecheck for a specific version of python, run 'make install-all-python' then set environment variable PYRIGHT_PYTHON=3.10 or similar
4040
@# PYRIGHT_PYTHON_IGNORE_WARNINGS avoids the overhead of making a request to github on every invocation
41-
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 UV_PROJECT_ENVIRONMENT=.venv$(subst .,,$(PYRIGHT_PYTHON)) uv run pyright --pythonversion $(PYRIGHT_PYTHON)
41+
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright $(if $(PYRIGHT_PYTHON),--pythonversion $(PYRIGHT_PYTHON))
4242

4343
.PHONY: typecheck-mypy
4444
typecheck-mypy:
@@ -52,7 +52,8 @@ typecheck-both: typecheck-pyright typecheck-mypy
5252

5353
.PHONY: test
5454
test: ## Run tests and collect coverage data
55-
uv run coverage run -m pytest -n auto --dist=loadgroup --durations=20
55+
@# To test using a specific version of python, run 'make install-all-python' then set environment variable PYTEST_PYTHON=3.10 or similar
56+
$(if $(PYTEST_PYTHON),UV_PROJECT_ENVIRONMENT=.venv$(subst .,,$(PYTEST_PYTHON))) uv run $(if $(PYTEST_PYTHON),--python $(PYTEST_PYTHON)) coverage run -m pytest -n auto --dist=loadgroup --durations=20
5657
@uv run coverage combine
5758
@uv run coverage report
5859

@@ -65,13 +66,6 @@ test-all-python: ## Run tests on Python 3.10 to 3.13
6566
@uv run coverage combine
6667
@uv run coverage report
6768

68-
PYTEST_PYTHON ?= 3.12
69-
.PHONY: test-specific-python
70-
test-specific-python: ## Run tests and collect coverage data using a specific python, specified by PYTEST_PYTHON env var
71-
UV_PROJECT_ENVIRONMENT=.venv$(subst .,,$(PYTEST_PYTHON)) uv run --python $(PYTEST_PYTHON) --all-extras --all-packages coverage run -p -m pytest -n auto --dist=loadgroup --durations=20
72-
@uv run coverage combine
73-
@uv run coverage report
74-
7569
.PHONY: testcov
7670
testcov: test ## Run tests and generate an HTML coverage report
7771
@echo "building coverage html"

0 commit comments

Comments
 (0)