microsoft/TypeAgent

Public

mirrored fromhttps://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dda5a80d403ca159b88a073886b478aca8ef2c4b

Branches

Tags

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

Clone

HTTPS

Download ZIP

python/ta/Makefile

50lines · 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 pytest test
20
21.PHONY: build
22build: venv
23 venv/bin/python -m build --wheel
24
25# Not phony -- the venv directory is the product of this rule.
26venv:
27 python3.12 -m venv venv || (rm -rf venv && exit 1)
28 venv/bin/pip -q install -r requirements.txt
29 @venv/bin/python --version
30 @venv/bin/black --version | head -1
31 @venv/bin/pyright --version
32 @venv/bin/python -m pytest --version
33
34.PHONY: clean
35clean:
36 rm -rf build dist venv *.egg-info
37 find . -type d -name __pycache__ | xargs rm -rf
38
39.PHONY: help
40help:
41 @echo "Usage: make [target]"
42 @echo "make help # Help (this message)"
43 @echo "make # Same as 'make all'"
44 @echo "make all # venv, format, check, test, build"
45 @echo "make format # Run black"
46 @echo "make check # Run pyright"
47 @echo "make test # Run pytest (tests are in test/)"
48 @echo "make build # Build the wheel (under dist/)"
49 @echo "make venv # Create venv/"
50 @echo "make clean # Remove build/, dist/, venv/, *.egg-info/"
51