-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.42 KB
/
Copy pathMakefile
File metadata and controls
49 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# ---------------------------------------------------------------------------
# Makefile for implementation/python -- PyTorch state-vector quantum simulator.
#
# Targets:
# make sync uv sync --group dev (install/refresh .venv)
# make test uv run pytest (full test suite)
# make test-cpu PYTORCH_DISABLE_MPS=1 ... (force CPU even on Apple Silicon)
# make lint uv run ruff check .
# make format uv run ruff format .
# make typecheck uv run mypy qubit tests
# make check lint + typecheck + test (the standard PR gate)
# make demo ALGO=bell|qft|grover|shor
# uv run qubit-demo --algo $(ALGO)
# make clean rm -rf .venv .pytest_cache .ruff_cache .mypy_cache
#
# The implementation/python module is managed by `uv`; the Makefile is a
# thin convenience wrapper. Most one-off operations can use `uv run <tool>`
# directly.
# ---------------------------------------------------------------------------
ALGO ?= bell
.PHONY: sync test test-cpu lint format typecheck check demo clean
sync:
uv sync --group dev
test:
uv run pytest
test-cpu:
PYTORCH_DISABLE_MPS=1 CUDA_VISIBLE_DEVICES= uv run pytest
lint:
uv run ruff check .
format:
uv run ruff format .
typecheck:
uv run mypy qubit tests
check: lint typecheck test
demo:
uv run qubit-demo --algo $(ALGO)
clean:
rm -rf .venv .pytest_cache .ruff_cache .mypy_cache build dist *.egg-info