Repository navigation
Fix: [Bug] Installer hard-codes PyPI.org instead of respecting PIP_INDEX_URL / UV_INDEX_URL - #13748
Conversation
c3de5b9 to
87cf1e8
Compare
|
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, 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! |
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.