Skip to content

Fix: [Bug] Installer hard-codes PyPI.org instead of respecting PIP_INDEX_URL / UV_INDEX_URL - #13748

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
SIDDARTHAREDDY8:oss-bhai-2026-10-14
Oct 21, 2026
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
SIDDARTHAREDDY8:oss-bhai-2026-10-14

Conversation

@SIDDARTHAREDDY8

Copy link
Copy Markdown

Fixes #13737.

Collision check clean: PR body search for 13737 returned 0, timeline shows only a rename event, 0 comments, unassigned. Fix scoped to the hard-coded PyPI version-resolution query in the Studio installer/update path: studio/backend/utils/update_status.py fetched the latest unsloth version only from https://pypi.org/pypi/unsloth/json. Added configured_package_index_urls()/package_index_url(): primary index from UV_DEFAULT_INDEX/UV_INDEX_URL (uv) or PIP_INDEX_URL (pip) replaces PyPI, UV_EXTRA_INDEX_URL/UV_INDEX/PIP_EXTRA_INDEX_URL are consulted in addition, and PyPI (https://pypi.org/simple) is the fallback only when none are set. _fetch_latest_pypi_version now queries each configured index in order: public PyPI via its classic JSON API, any other index via its PEP 503/691 project page (/unsloth/), parsing both the classic {info.version} shape and the PEP 691 {versions} shape (newest stable). Added 10 unit tests with the env vars set/unset verifying the chosen index URL and that fetches go to the configured mirror, never pypi.org. Note: install.sh's own PyPI probe (_pypi_unsloth_admits_torch) already refuses to trust public PyPI when a uv index is configured via _mirror_configured, so it was left unchanged. Branch pushed to SIDDARTHAREDDY8/unsloth at commit bf1595c, base main (daab3bc).

Tests pass: New tests: 10 passed via pytest --noconftest (studio/backend/tests/test_update_status_index_url.py). The backend conftest cannot load in this environment (ModuleNotFoundError: huggingface_hub, pre-existing; the existing test_combined_update.py fails collection the same way), so the new file was run with --noconftest; it sets up its own sys.path like sibling tests. Ruff not installed, not run.

@danielhanchen
danielhanchen merged commit 93fda20 into unslothai:main Oct 21, 2026
@danielhanchen

Copy link
Copy Markdown
Member

Thank you for the PR and for jumping on #13737 so quickly, we really appreciate it!

After digging in, it turned out the installer already honors these settings: with pypi.org blocked, pip install unsloth with PIP_INDEX_URL, uv pip install unsloth with UV_INDEX_URL / UV_DEFAULT_INDEX, and a full Studio install.sh run with UV_INDEX_URL all installed from the mirror and never reached pypi.org. The failure people hit with feeds that lag PyPI was fixed separately in #14133, so I closed #13737 as not reproducible. This PR changes the Studio "update available" check rather than the installer, so it would not change what the issue describes, and we would rather not carry the extra index handling there.

So we won't be taking the code changes, but we still want to credit you for the work. I have reduced the PR to a single empty commit authored by you and am merging that, so you will show up as a contributor to Unsloth. Thanks again, and we would be glad to see more PRs from you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Installer hard-codes PyPI.org instead of respecting PIP_INDEX_URL / UV_INDEX_URL

2 participants