microsoft/TypeAgent

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
4d2dfc6aafd65d8a6a64a32bd8daef366db48eea

Branches

Tags

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

Clone

HTTPS

Download ZIP

python/ta/make.bat

70lines · 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"=="clean" goto clean
19if /I "%~1"=="help" goto help
20
21echo Unknown command: %~1
22goto help
23
24:format
25if not exist "venv\" call make.bat venv
26echo Formatting code...
27venv\Scripts\black typeagent
28goto end
29
30:check
31if not exist "venv\" call make.bat venv
32echo Running checks...
33venv\Scripts\pyright --pythonpath venv\Scripts\python typeagent *.py
34goto end
35
36:test
37if not exist "venv\" call make.bat venv
38echo Running tests...
39venv\Scripts\python -m pytest
40goto end
41
42:build
43if not exist "venv\" call make.bat venv
44echo Building package...
45venv\Scripts\python -m build --wheel
46goto end
47
48:venv
49echo Creating virtual environment...
50python3.12 -m venv venv
51venv\Scripts\pip -q install -r requirements.txt
52venv\Scripts\python --version
53venv\Scripts\black --version
54venv\Scripts\pyright --version
55venv\Scripts\python -m pytest --version
56
57goto end
58
59:clean
60echo Sorry, you have to clean up manually.
61echo These are to be deleted: build dist *.egg-info venv
62echo Delete venv if the requirements have changed.
63echo The others are products of the build step.
64goto end
65
66:help
67echo Usage: .\make [format^|check^|test^|build^|venv^|clean^|help]
68goto end
69
70:end
71