Raise a helpful error for VCS URLs in install() - #277
Merged
Conversation
ryanking13
reviewed
May 20, 2026
| - `install` now raises a helpful `ValueError` when given a VCS URL | ||
| (`git+`, `hg+`, `svn+`, `bzr+`) instead of an opaque parser error, | ||
| explaining that micropip only installs prebuilt wheels. | ||
| [#77](https://github.com/pyodide/micropip/issues/77) |
Member
There was a problem hiding this comment.
Suggested change
| [#77](https://github.com/pyodide/micropip/issues/77) | |
| [#277](https://github.com/pyodide/micropip/pull/277) |
agriyakhetarpal
approved these changes
May 20, 2026
Comment on lines
+86
to
+92
| if isinstance(req, str) and _looks_like_vcs_url(req): | ||
| raise ValueError( | ||
| f"Cannot install {req!r}: micropip only installs prebuilt wheels " | ||
| "and does not support installing from a VCS URL " | ||
| "(git+, hg+, svn+, bzr+). Provide a wheel URL or a package name " | ||
| "available on a configured index." | ||
| ) |
Member
There was a problem hiding this comment.
Suggested change
| if isinstance(req, str) and _looks_like_vcs_url(req): | |
| raise ValueError( | |
| f"Cannot install {req!r}: micropip only installs prebuilt wheels " | |
| "and does not support installing from a VCS URL " | |
| "(git+, hg+, svn+, bzr+). Provide a wheel URL or a package name " | |
| "available on a configured index." | |
| ) | |
| if isinstance(req, str) and _looks_like_vcs_url(req): | |
| raise ValueError( | |
| f"Cannot install {req!r}: micropip only installs prebuilt wheels " | |
| "and does not support installing from a VCS URL " | |
| "(git+, hg+, svn+, bzr+). Provide a URL pointing to a wheel " | |
| "or a package name available on a configured index." | |
| ) |
(nit: sorry, I know) – I think this would be a bit cleaner!
Member
|
Oh maybe I clicked the merge button too soon 😅 |
Member
|
Oops! |
Member
|
@copilot open A PR that addresses comments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77. When
installreceives a VCS URL (git+,hg+,svn+,bzr+) it now raises aValueErrorthat explains micropip only installs prebuilt wheels, instead of the opaquepackagingparser stack trace shown in the issue. @ryanking13 said "Sure, PR welcome" to improving that message. Includes a parametrized test covering the four VCS prefixes and a CHANGELOG entry.