microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
python/ta/make.bat
70lines · modecode
| 1 | :: Copyright (c) Microsoft Corporation. |
| 2 | :: Licensed under the MIT License. |
| 3 | |
| 4 | @echo off |
| 5 | if "%~1"=="" goto help |
| 6 | |
| 7 | if /I "%~1"=="help" goto help |
| 8 | if /I "%~1"=="venv" goto venv |
| 9 | if /I "%~1"=="check" goto check |
| 10 | if /I "%~1"=="test" goto test |
| 11 | if /I "%~1"=="demo" goto demo |
| 12 | if /I "%~1"=="clean" goto clean |
| 13 | if /I "%~1"=="format" goto format |
| 14 | if /I "%~1"=="build" goto build |
| 15 | |
| 16 | echo Unknown command: %~1 |
| 17 | goto help |
| 18 | |
| 19 | :format |
| 20 | if not exist "venv\" call make.bat venv |
| 21 | echo Formatting code... |
| 22 | venv\Scripts\black typeagent *.py |
| 23 | goto end |
| 24 | |
| 25 | :check |
| 26 | if not exist "venv\" call make.bat venv |
| 27 | echo Running checks... |
| 28 | venv\Scripts\pyright --pythonpath venv\Scripts\python typeagent *.py |
| 29 | goto end |
| 30 | |
| 31 | :test |
| 32 | if not exist "venv\" call make.bat venv |
| 33 | echo Running tests... |
| 34 | venv\Scripts\python -m typeagent.podcasts testdata\npr.txt |
| 35 | goto end |
| 36 | |
| 37 | :demo |
| 38 | if not exist "venv\" call make.bat venv |
| 39 | echo Running demo... |
| 40 | venv\Scripts\python demo.py |
| 41 | goto end |
| 42 | |
| 43 | :build |
| 44 | if not exist "venv\" call make.bat venv |
| 45 | echo Building package... |
| 46 | venv\Scripts\python -m build --wheel |
| 47 | goto end |
| 48 | |
| 49 | :venv |
| 50 | echo Creating virtual environment... |
| 51 | python3.12 -m venv venv |
| 52 | venv\Scripts\pip -q install -r requirements.txt |
| 53 | venv\Scripts\python --version |
| 54 | venv\Scripts\pyright --version |
| 55 | venv\Scripts\black --version |
| 56 | |
| 57 | goto end |
| 58 | |
| 59 | :clean |
| 60 | echo Sorry, you have to clean up manually. |
| 61 | echo These are to be deleted: build dist *.egg-info venv |
| 62 | echo Delete venv if the requirements have changed. |
| 63 | echo The others are products of the build step. |
| 64 | goto end |
| 65 | |
| 66 | :help |
| 67 | echo Usage: make.bat [format^|check^|test^|demo^|build^|venv^|clean^|help] |
| 68 | goto end |
| 69 | |
| 70 | :end |
| 71 | |