diff --git a/.github/workflows/studio-windows-api-smoke.yml b/.github/workflows/studio-windows-api-smoke.yml index 4ed1f93274..b1d6a31b1e 100644 --- a/.github/workflows/studio-windows-api-smoke.yml +++ b/.github/workflows/studio-windows-api-smoke.yml @@ -94,6 +94,20 @@ jobs: exit 1 fi + - name: Patch Studio venv with full typer / pydantic dep trees + # Belt-and-suspenders: install.ps1's --no-deps install of + # no-torch-runtime.txt drops typer's and pydantic's runtime + # deps unless explicitly pinned. Re-install the ones whose + # deps don't pull torch. + run: | + STUDIO_PY=~/.unsloth/studio/unsloth_studio/Scripts/python.exe + if [ ! -f "$STUDIO_PY" ]; then + echo "::error::Studio venv python not at $STUDIO_PY" + ls -la ~/.unsloth/studio/ || true + exit 1 + fi + "$STUDIO_PY" -m pip install --upgrade typer pydantic huggingface_hub + - name: Install pyjwt for the JWT-expiry forge test run: python -m pip install 'pyjwt>=2.6' diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml index e50dcfe6a9..e387e8326f 100644 --- a/.github/workflows/studio-windows-inference-smoke.yml +++ b/.github/workflows/studio-windows-inference-smoke.yml @@ -104,6 +104,20 @@ jobs: exit 1 fi + - name: Patch Studio venv with full typer / pydantic dep trees + # Belt-and-suspenders: install.ps1's --no-deps install of + # no-torch-runtime.txt drops typer's and pydantic's runtime + # deps unless explicitly pinned. Re-install the ones whose + # deps don't pull torch. + run: | + STUDIO_PY=~/.unsloth/studio/unsloth_studio/Scripts/python.exe + if [ ! -f "$STUDIO_PY" ]; then + echo "::error::Studio venv python not at $STUDIO_PY" + ls -la ~/.unsloth/studio/ || true + exit 1 + fi + "$STUDIO_PY" -m pip install --upgrade typer pydantic huggingface_hub + - name: Install OpenAI + Anthropic Python SDKs run: python -m pip install 'openai>=1.50' 'anthropic>=0.40' @@ -325,6 +339,20 @@ jobs: exit 1 fi + - name: Patch Studio venv with full typer / pydantic dep trees + # Belt-and-suspenders: install.ps1's --no-deps install of + # no-torch-runtime.txt drops typer's and pydantic's runtime + # deps unless explicitly pinned. Re-install the ones whose + # deps don't pull torch. + run: | + STUDIO_PY=~/.unsloth/studio/unsloth_studio/Scripts/python.exe + if [ ! -f "$STUDIO_PY" ]; then + echo "::error::Studio venv python not at $STUDIO_PY" + ls -la ~/.unsloth/studio/ || true + exit 1 + fi + "$STUDIO_PY" -m pip install --upgrade typer pydantic huggingface_hub + - name: Reset auth + boot Studio (API-only, default tool policy) run: | unsloth studio reset-password @@ -637,6 +665,20 @@ jobs: exit 1 fi + - name: Patch Studio venv with full typer / pydantic dep trees + # Belt-and-suspenders: install.ps1's --no-deps install of + # no-torch-runtime.txt drops typer's and pydantic's runtime + # deps unless explicitly pinned. Re-install the ones whose + # deps don't pull torch. + run: | + STUDIO_PY=~/.unsloth/studio/unsloth_studio/Scripts/python.exe + if [ ! -f "$STUDIO_PY" ]; then + echo "::error::Studio venv python not at $STUDIO_PY" + ls -la ~/.unsloth/studio/ || true + exit 1 + fi + "$STUDIO_PY" -m pip install --upgrade typer pydantic huggingface_hub + - name: Install OpenAI + Anthropic Python SDKs run: python -m pip install 'openai>=1.50' 'anthropic>=0.40' diff --git a/.github/workflows/studio-windows-ui-smoke.yml b/.github/workflows/studio-windows-ui-smoke.yml index f2a497ef7e..a96b54d28a 100644 --- a/.github/workflows/studio-windows-ui-smoke.yml +++ b/.github/workflows/studio-windows-ui-smoke.yml @@ -117,6 +117,20 @@ jobs: fi echo "install.ps1 installed the Windows prebuilt llama.cpp" + - name: Patch Studio venv with full typer / pydantic dep trees + # Belt-and-suspenders: install.ps1's --no-deps install of + # no-torch-runtime.txt drops typer's and pydantic's runtime + # deps unless explicitly pinned. Re-install the ones whose + # deps don't pull torch. + run: | + STUDIO_PY=~/.unsloth/studio/unsloth_studio/Scripts/python.exe + if [ ! -f "$STUDIO_PY" ]; then + echo "::error::Studio venv python not at $STUDIO_PY" + ls -la ~/.unsloth/studio/ || true + exit 1 + fi + "$STUDIO_PY" -m pip install --upgrade typer pydantic huggingface_hub + - name: Install Playwright + Chromium # No --with-deps on Windows: that flag installs Linux apt # packages. windows-latest ships the system frameworks diff --git a/.github/workflows/studio-windows-update-smoke.yml b/.github/workflows/studio-windows-update-smoke.yml index 991b64aeec..551760825a 100644 --- a/.github/workflows/studio-windows-update-smoke.yml +++ b/.github/workflows/studio-windows-update-smoke.yml @@ -95,6 +95,32 @@ jobs: fi echo "install.ps1 installed the Windows prebuilt llama.cpp" + - name: Patch Studio venv with full typer / pydantic dep trees + # install.ps1 runs `uv pip install --no-deps -r + # no-torch-runtime.txt` to keep torch out of transitive + # resolution from accelerate/peft/trl. That also drops + # typer's and pydantic's runtime deps unless they're + # explicitly pinned in no-torch-runtime.txt. We pin the + # known ones (click, shellingham, annotated-doc, rich, + # pydantic-core, annotated-types, typing-inspection, ...) + # but typer / pydantic minor versions can introduce new + # transitive deps that are NOT in our pin list. + # + # Belt-and-suspenders: re-install typer + pydantic + + # huggingface_hub WITH their deps into the Studio venv. + # `pip install --upgrade` only adds missing packages; it + # never down-shifts an installed version. Cannot pull + # torch (none of typer / pydantic / huggingface_hub depend + # on it). + run: | + STUDIO_PY=~/.unsloth/studio/unsloth_studio/Scripts/python.exe + if [ ! -f "$STUDIO_PY" ]; then + echo "::error::Studio venv python not at $STUDIO_PY" + ls -la ~/.unsloth/studio/ || true + exit 1 + fi + "$STUDIO_PY" -m pip install --upgrade typer pydantic huggingface_hub + - name: First update should be a no-op (prebuilt already validated) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/studio/backend/requirements/no-torch-runtime.txt b/studio/backend/requirements/no-torch-runtime.txt index 79a69f67d2..7859cce7f3 100644 --- a/studio/backend/requirements/no-torch-runtime.txt +++ b/studio/backend/requirements/no-torch-runtime.txt @@ -23,12 +23,13 @@ markdown-it-py>=3.0 mdurl>=0.1 pygments>=2.0 pydantic -# pydantic 2.x's compiled core lives in a SEPARATE wheel and is NOT -# bundled with the pydantic wheel itself. With --no-deps, `import -# pydantic` blows up with `ModuleNotFoundError: No module named -# 'pydantic_core'` on a fresh venv. +# pydantic 2.x deps. With --no-deps, `import pydantic` blows up +# with `ModuleNotFoundError: 'pydantic_core'` (compiled Rust core, +# separate wheel), then `'annotated_types'`, then +# `'typing_inspection'` (used by pydantic 2.10+ for fields). pydantic-core annotated-types>=0.6 +typing-inspection>=0.4 pyyaml nest-asyncio