-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
64 lines (53 loc) · 2.8 KB
/
start.bat
File metadata and controls
64 lines (53 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@echo off
rem ─────────────────────────────────────────────────────────────────────
rem Databricks API Explorer — startup script (Windows)
rem ─────────────────────────────────────────────────────────────────────
setlocal enabledelayedexpansion
cd /d "%~dp0"
set VENV_DIR=.venv
set PORT=8050
if defined DATABRICKS_APP_PORT set PORT=%DATABRICKS_APP_PORT%
rem ── Find Python ─────────────────────────────────────────────────────
set PYTHON=
where python3 >nul 2>&1 && set PYTHON=python3
if not defined PYTHON (
where python >nul 2>&1 && set PYTHON=python
)
if not defined PYTHON (
echo ERROR: Python not found. Install Python 3.11+ and add it to PATH.
pause
exit /b 1
)
rem ── Check Python version ────────────────────────────────────────────
for /f "tokens=*" %%v in ('%PYTHON% -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"') do set PY_VERSION=%%v
for /f "tokens=*" %%v in ('%PYTHON% -c "import sys; print(sys.version_info.major)"') do set PY_MAJOR=%%v
for /f "tokens=*" %%v in ('%PYTHON% -c "import sys; print(sys.version_info.minor)"') do set PY_MINOR=%%v
if !PY_MAJOR! lss 3 (
echo ERROR: Python 3.11+ required ^(found %PY_VERSION%^).
pause
exit /b 1
)
if !PY_MAJOR! equ 3 if !PY_MINOR! lss 11 (
echo ERROR: Python 3.11+ required ^(found %PY_VERSION%^).
pause
exit /b 1
)
echo Using Python %PY_VERSION%
rem ── Create virtual environment if missing ───────────────────────────
if not exist "%VENV_DIR%\Scripts\activate.bat" (
echo Creating virtual environment...
%PYTHON% -m venv %VENV_DIR%
)
rem ── Activate virtual environment ────────────────────────────────────
call %VENV_DIR%\Scripts\activate.bat
rem ── Install / update dependencies ───────────────────────────────────
echo Installing dependencies...
pip install -q --upgrade pip
pip install -q -r requirements.txt
rem ── Launch ──────────────────────────────────────────────────────────
echo.
echo Starting Databricks API Explorer on http://localhost:%PORT%
echo Press Ctrl+C to stop.
echo.
python app.py
pause