microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2f06d474b6949d65d73ee95868ac29c3f185992e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

python/ta/Makefile

72lines · 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
7all: venv format check test build
8
9.PHONY: format
10format: venv
11 .venv/bin/black typeagent test
12
13.PHONY: check
14check: venv
15 .venv/bin/pyright --pythonpath .venv/bin/python typeagent test
16
17.PHONY: test
18test: venv
19 .venv/bin/python -m coverage run --source=typeagent -m pytest test
20
21.PHONY: demo
22demo: venv
23 .venv/bin/python -m typeagent.demo
24
25.PHONY: compare
26compare: venv
27 .venv/bin/python -m test.cmpsearch
28
29.PHONY: profile
30profile: venv
31 </dev/null .venv/bin/python -m cProfile -s ncalls -m test.cmpsearch --interactive --podcast ~/AISystems-Archive/data/knowpro/test/indexes/All_Episodes_index | head -60
32
33.PHONY: scaling
34scaling: venv
35 </dev/null .venv/bin/python -m test.cmpsearch --interactive --podcast ~/AISystems-Archive/data/knowpro/test/indexes/All_Episodes_index
36
37.PHONY: build
38build: venv
39 .venv/bin/python -m build --wheel
40
41.PHONY: venv
42venv: .venv
43
44.venv:
45 @echo "(If 'uv' fails with 'No such file or directory', try 'make install-uv')"
46 uv sync -q
47 @.venv/bin/black --version | sed 's/, / /'
48 @.venv/bin/pyright --version
49 @.venv/bin/pytest --version
50
51install-uv:
52 curl -Ls https://astral.sh/uv/install.sh | sh
53
54.PHONY: clean
55clean:
56 rm -rf build dist venv .venv *.egg-info
57 rm -f *_data.json *_embedding.bin
58 find . -type d -name __pycache__ | xargs rm -rf
59
60.PHONY: help
61help:
62 @echo "Usage: make [target]"
63 @echo "make help # Help (this message)"
64 @echo "make # Same as 'make all'"
65 @echo "make all # venv, format, check, test, build"
66 @echo "make format # Run black"
67 @echo "make check # Run pyright"
68 @echo "make test # Run pytest (tests are in test/)"
69 @echo "make build # Build the wheel (under dist/)"
70 @echo "make venv # Create .venv/"
71 @echo "make clean # Remove build/, dist/, .venv/, *.egg-info/"
72 @echo "make install-uv # Install uv (if not already installed)"