microsoft/TypeAgent

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1cbce752809ebfd6913805ffbdf05b2473abdf9b

Branches

Tags

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

Clone

HTTPS

Download ZIP

python/ta/make.bat

80lines · modecode

1:: Copyright (c) Microsoft Corporation.
2:: Licensed under the MIT License.
3
4:: This is a batch file to run common actions.
5:: It can format the code, check the code, run the tests,
6:: build the package, create a virtual environment, and clean up.
7:: To avoid having to type `./make` all the time,
8:: use `set-alias make ".\make.bat"` in PowerShell.
9
10@echo off
11if "%~1"=="" goto help
12
13if /I "%~1"=="format" goto format
14if /I "%~1"=="check" goto check
15if /I "%~1"=="test" goto test
16if /I "%~1"=="build" goto build
17if /I "%~1"=="venv" goto venv
18if /I "%~1"=="install-uv" goto install-uv
19if /I "%~1"=="clean" goto clean
20if /I "%~1"=="help" goto help
21
22echo Unknown command: %~1
23goto help
24
25:format
26if not exist ".venv\" call make.bat venv
27echo Formatting code...
28.venv\Scripts\black typeagent test
29goto end
30
31:check
32if not exist ".venv\" call make.bat venv
33echo Running checks...
34.venv\Scripts\pyright --pythonpath .venv\Scripts\python typeagent test
35goto end
36
37:test
38if not exist ".venv\" call make.bat venv
39echo Running tests...
40.venv\Scripts\python -m pytest test
41goto end
42
43:build
44if not exist ".venv\" call make.bat venv
45echo Building package...
46.venv\Scripts\python -m build --wheel --installer uv
47goto end
48
49:venv
50echo Creating virtual environment...
51uv sync -q
52.venv\Scripts\python --version
53.venv\Scripts\black --version
54.venv\Scripts\pyright --version
55.venv\Scripts\python -m pytest --version
56goto end
57
58:install-uv
59echo Installing uv requires Administrator mode!
60echo 1. Using PowerShell in Administrator mode:
61echo Invoke-RestMethod https://astral.sh/uv/install.ps1 ^| Invoke-Expression
62echo 2. Add ~/.local/bin to $env:PATH, e.g. by putting
63echo $env:PATH += ";$HOME\.local\bin
64echo in your PowerShell profile ($PROFILE) and restarting PowerShell.
65echo (Sorry, I have no idea how to do that in cmd.exe.)
66goto end
67
68:clean
69if exist build rmdir /s /q build
70if exist dist rmdir /s /q dist
71if exist typeagent.egg-info rmdir /s /q typeagent.egg-info
72if exist .venv rmdir /s /q .venv
73if exist .pytest_cache rmdir /s /q .pytest_cache
74goto end
75
76:help
77echo Usage: .\make [format^|check^|test^|build^|venv^|install-uv^|clean^|help]
78goto end
79
80:end
81