microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
python/ta/Makefile
57lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | # This is Guido's Makefile. Please don't make it complicated. |
| 5 | |
| 6 | .PHONY: all |
| 7 | all: venv format check test build |
| 8 | |
| 9 | .PHONY: format |
| 10 | format: venv |
| 11 | .venv/bin/black typeagent test |
| 12 | |
| 13 | .PHONY: check |
| 14 | check: venv |
| 15 | .venv/bin/pyright --pythonpath .venv/bin/python typeagent test |
| 16 | |
| 17 | .PHONY: test |
| 18 | test: venv |
| 19 | .venv/bin/python -m pytest test |
| 20 | |
| 21 | .PHONY: build |
| 22 | build: venv |
| 23 | .venv/bin/python -m build --wheel |
| 24 | |
| 25 | .PHONY: venv |
| 26 | venv: .venv |
| 27 | |
| 28 | .venv: |
| 29 | @echo "(If 'uv' fails with 'No such file or directory', try 'make install-uv')" |
| 30 | uv sync -q |
| 31 | @.venv/bin/python --version |
| 32 | @.venv/bin/black --version | head -1 |
| 33 | @.venv/bin/pyright --version |
| 34 | @.venv/bin/python -m pytest --version |
| 35 | |
| 36 | install-uv: |
| 37 | curl -Ls https://astral.sh/uv/install.sh | sh |
| 38 | |
| 39 | .PHONY: clean |
| 40 | clean: |
| 41 | rm -rf build dist venv .venv *.egg-info |
| 42 | rm -f *_data.json *_embedding.bin |
| 43 | find . -type d -name __pycache__ | xargs rm -rf |
| 44 | |
| 45 | .PHONY: help |
| 46 | help: |
| 47 | @echo "Usage: make [target]" |
| 48 | @echo "make help # Help (this message)" |
| 49 | @echo "make # Same as 'make all'" |
| 50 | @echo "make all # venv, format, check, test, build" |
| 51 | @echo "make format # Run black" |
| 52 | @echo "make check # Run pyright" |
| 53 | @echo "make test # Run pytest (tests are in test/)" |
| 54 | @echo "make build # Build the wheel (under dist/)" |
| 55 | @echo "make venv # Create .venv/" |
| 56 | @echo "make clean # Remove build/, dist/, .venv/, *.egg-info/" |
| 57 | @echo "make install-uv # Install uv (if not already installed)" |
| 58 | |