File tree 1 file changed +5
-2
lines changed
packages/pyodide-kernel/py/piplite/piplite
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ def add_requirement(self, req: str):
50
50
51
51
52
52
REQ_FILE_PREFIX = r"^(-r|--requirements)\s*=?\s*(.*)\s*"
53
- INDEX_URL_PREFIX = r"^(--index-url|-i)\s*=?\s*(.*)\s*"
53
+
54
+ # Matches a pip-style index URL, with support for quote enclosures
55
+ INDEX_URL_PREFIX = r'^(--index-url|-i)\s*=?\s*(?:"([^"]*)"|\047([^\047]*)\047|([^\s]*))\s*$'
54
56
55
57
56
58
__all__ = ["get_transformed_code" ]
@@ -259,7 +261,8 @@ async def _packages_from_requirements_line(
259
261
# Check for index URL - this becomes the new active index URL.
260
262
index_match = re .match (INDEX_URL_PREFIX , req )
261
263
if index_match :
262
- context .index_url = index_match [2 ].strip ()
264
+ url = next (group for group in index_match .groups ()[1 :] if group is not None )
265
+ context .index_url = url .strip ()
263
266
return
264
267
265
268
if req .startswith ("-" ):
You can’t perform that action at this time.
0 commit comments