Skip to content

Commit 5fbc43d

Browse files
HanSur94claude
andcommitted
feat: bundle all Windows wheels for fully offline installation
- Add vendor/ with 98 pre-built wheels for Windows x64 (Python 3.10, 3.11, 3.12) — 58MB total - Add requirements-lock.txt with pinned dependency versions - Add update_vendor.bat helper to refresh wheels - Update install.bat: detects vendor/ and uses --no-index --find-links for zero-network installation - Falls back to PyPI if vendor/ is absent The installer now works fully offline on corporate machines with no internet or blocked PyPI access. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 09a3215 commit 5fbc43d

101 files changed

Lines changed: 167 additions & 20 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

install.bat

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,27 +198,32 @@ echo [OK] Virtual environment ready at %VENV_DIR%
198198
echo.
199199

200200
:: ----------------------------------------------------------------------------
201-
:: 4b. Ensure setuptools and wheel are available in the venv.
202-
:: Python 3.10 venv ships these by default, but verify to be safe.
203-
:: --trusted-host flags handle corporate proxies with SSL inspection.
201+
:: 4b. Detect bundled vendor/ directory for fully offline installation.
202+
:: All dependencies (wheels) are shipped in vendor/ — no internet needed.
204203
:: ----------------------------------------------------------------------------
205204
set "PIP_TRUST=--trusted-host pypi.org --trusted-host files.pythonhosted.org"
205+
set "VENDOR_DIR=%~dp0vendor"
206+
set "OFFLINE="
206207

207-
:: Check if setuptools is already in the venv (it usually is from python -m venv)
208+
if exist "%VENDOR_DIR%\*.whl" (
209+
echo [OK] Bundled wheels found in vendor/ — installing fully offline.
210+
set "OFFLINE=1"
211+
) else (
212+
echo [INFO] No vendor/ directory — will download dependencies from PyPI.
213+
)
214+
echo.
215+
216+
:: Ensure setuptools is available (needed for MATLAB Engine build)
208217
python -c "import setuptools" >nul 2>&1
209218
if %errorlevel% neq 0 (
210-
echo Bootstrapping setuptools and wheel...
211-
python -m pip install --upgrade pip setuptools wheel %PIP_TRUST% --quiet 2>&1
212-
if %errorlevel% neq 0 (
213-
echo [WARNING] Could not install setuptools from network.
214-
echo MATLAB Engine API install may fail if build tools are missing.
219+
if defined OFFLINE (
220+
pip install setuptools wheel --no-index --find-links "%VENDOR_DIR%" --quiet 2>&1
221+
) else (
222+
python -m pip install --upgrade pip setuptools wheel %PIP_TRUST% --quiet 2>&1
215223
)
216224
) else (
217225
echo [OK] setuptools already available in venv.
218-
:: Try upgrading pip quietly — not critical if it fails
219-
python -m pip install --upgrade pip %PIP_TRUST% --quiet 2>nul
220226
)
221-
echo.
222227

223228
:: ----------------------------------------------------------------------------
224229
:: 5. Install MATLAB Engine API (fully offline — no downloads needed)
@@ -257,20 +262,36 @@ if %errorlevel% equ 0 (
257262
echo.
258263

259264
:: ----------------------------------------------------------------------------
260-
:: 6. Install MATLAB MCP Server (into the venv — no admin needed)
265+
:: 6. Install MATLAB MCP Server and all dependencies
266+
:: Uses bundled vendor/ wheels if available (fully offline),
267+
:: otherwise falls back to PyPI.
261268
:: ----------------------------------------------------------------------------
262269
:install_mcp
263270
echo [5/6] Installing MATLAB MCP Server...
264271

265-
:: Prefer local source if available, otherwise pull from PyPI
266-
:: Use non-editable install (pip install .) for maximum compatibility
267272
set "SOURCE_DIR=%~dp0"
268-
if exist "%SOURCE_DIR%pyproject.toml" (
269-
echo Installing from local source...
270-
pip install "%SOURCE_DIR%." %PIP_TRUST% --quiet
273+
set "REQ_FILE=%SOURCE_DIR%requirements-lock.txt"
274+
275+
if defined OFFLINE (
276+
echo Installing dependencies from bundled wheels (offline^)...
277+
if exist "%REQ_FILE%" (
278+
pip install -r "%REQ_FILE%" --no-index --find-links "%VENDOR_DIR%" --quiet
279+
if %errorlevel% neq 0 (
280+
echo [ERROR] Failed to install dependencies from vendor/.
281+
pause
282+
exit /b 1
283+
)
284+
)
285+
echo Installing MCP server from local source...
286+
pip install "%SOURCE_DIR%." --no-deps --no-build-isolation --quiet
271287
) else (
272-
echo Installing from PyPI...
273-
pip install matlab-mcp-python %PIP_TRUST% --quiet
288+
if exist "%SOURCE_DIR%pyproject.toml" (
289+
echo Installing from local source...
290+
pip install "%SOURCE_DIR%." %PIP_TRUST% --quiet
291+
) else (
292+
echo Installing from PyPI...
293+
pip install matlab-mcp-python %PIP_TRUST% --quiet
294+
)
274295
)
275296

276297
if %errorlevel% neq 0 (

requirements-lock.txt

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
aiosqlite==0.22.1
2+
annotated-doc==0.0.4
3+
annotated-types==0.7.0
4+
anyio==4.12.1
5+
attrs==26.1.0
6+
Authlib==1.6.9
7+
backports.tarfile==1.2.0
8+
beartype==0.22.9
9+
cachetools==7.0.5
10+
certifi==2026.2.25
11+
cffi==2.0.0
12+
click==8.3.1
13+
cloudpickle==3.1.2
14+
cronsim==2.7
15+
cryptography==46.0.5
16+
cyclopts==4.10.0
17+
diskcache==5.6.3
18+
dnspython==2.8.0
19+
docstring_parser==0.17.0
20+
docutils==0.22.4
21+
email-validator==2.3.0
22+
exceptiongroup==1.3.1
23+
fakeredis==2.34.1
24+
fastmcp==2.14.5
25+
h11==0.16.0
26+
httpcore==1.0.9
27+
httpx==0.28.1
28+
httpx-sse==0.4.3
29+
idna==3.11
30+
importlib_metadata==8.7.1
31+
jaraco.classes==3.4.0
32+
jaraco.context==6.1.1
33+
jaraco.functools==4.4.0
34+
jsonref==1.1.0
35+
jsonschema==4.26.0
36+
jsonschema-path==0.4.5
37+
jsonschema-specifications==2025.9.1
38+
keyring==25.7.0
39+
lupa==2.6
40+
markdown-it-py==4.0.0
41+
mcp==1.26.0
42+
mdurl==0.1.2
43+
more-itertools==10.8.0
44+
narwhals==2.18.0
45+
openapi-pydantic==0.5.1
46+
opentelemetry-api==1.40.0
47+
packaging==26.0
48+
pathable==0.5.0
49+
pathvalidate==3.3.1
50+
pillow==12.1.1
51+
platformdirs==4.9.4
52+
plotly==6.6.0
53+
prometheus_client==0.24.1
54+
py-key-value-aio==0.3.0
55+
py-key-value-shared==0.3.0
56+
pycparser==3.0
57+
pydantic==2.12.5
58+
pydantic-settings==2.13.1
59+
pydantic_core==2.41.5
60+
pydocket==0.18.2
61+
Pygments==2.19.2
62+
PyJWT==2.12.1
63+
pyperclip==1.11.0
64+
python-dotenv==1.2.2
65+
python-json-logger==4.0.0
66+
python-multipart==0.0.22
67+
PyYAML==6.0.3
68+
redis==7.3.0
69+
referencing==0.37.0
70+
rich==14.3.3
71+
rich-rst==1.3.2
72+
rpds-py==0.30.0
73+
shellingham==1.5.4
74+
sortedcontainers==2.4.0
75+
sse-starlette==3.3.3
76+
starlette==0.52.1
77+
typer==0.24.1
78+
typing-inspection==0.4.2
79+
typing_extensions==4.15.0
80+
uncalled-for==0.2.0
81+
uvicorn==0.42.0
82+
websockets==16.0
83+
zipp==3.23.0

update_vendor.bat

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@echo off
2+
setlocal EnableDelayedExpansion
3+
4+
:: ============================================================================
5+
:: Refresh bundled vendor/ wheels for offline Windows installation.
6+
:: Run this on a machine with internet access, then commit vendor/.
7+
:: ============================================================================
8+
9+
echo.
10+
echo Updating vendor/ wheels for offline installation...
11+
echo.
12+
13+
set "SCRIPT_DIR=%~dp0"
14+
set "VENDOR_DIR=%SCRIPT_DIR%vendor"
15+
set "REQ_FILE=%SCRIPT_DIR%requirements-lock.txt"
16+
17+
if not exist "%REQ_FILE%" (
18+
echo [ERROR] requirements-lock.txt not found.
19+
pause
20+
exit /b 1
21+
)
22+
23+
:: Clean old wheels
24+
if exist "%VENDOR_DIR%" (
25+
echo Removing old wheels...
26+
rd /s /q "%VENDOR_DIR%"
27+
)
28+
mkdir "%VENDOR_DIR%"
29+
30+
:: Download for Python 3.10, 3.11, 3.12 — Windows x64
31+
for %%v in (310 311 312) do (
32+
echo Downloading wheels for Python %%v win_amd64...
33+
pip download -r "%REQ_FILE%" --platform win_amd64 --python-version %%v --only-binary=:all: -d "%VENDOR_DIR%" --quiet 2>&1
34+
)
35+
36+
echo.
37+
echo Done. Vendor directory:
38+
dir /b "%VENDOR_DIR%\*.whl" | find /c ".whl"
39+
echo wheel files in %VENDOR_DIR%
40+
echo.
41+
42+
pause
43+
endlocal
17 KB
Binary file not shown.
5.18 KB
Binary file not shown.
13.3 KB
Binary file not shown.
111 KB
Binary file not shown.
66 KB
Binary file not shown.
238 KB
Binary file not shown.
29.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)