File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -334,13 +334,16 @@ def _create_constraints_file() -> str:
334
334
if not constraints :
335
335
return ""
336
336
337
- if len (constraints .split (maxsplit = 1 )) > 1 :
338
- raise ValueError (
339
- "PIP_CONSTRAINT contains spaces so pip will misinterpret it. Make sure the path to pyodide has no spaces.\n "
340
- "See https://github.com/pypa/pip/issues/13283"
341
- )
342
-
337
+ # If a path to a file specified PIP_CONSTRAINT contains spaces, pip will misinterpret
338
+ # it as multiple files; see https://github.com/pypa/pip/issues/13283
339
+ # We work around this by converting the path to a URI.
343
340
constraints_file = Path (constraints )
341
+ constraints = (
342
+ constraints_file .as_uri ()
343
+ if " " in str (constraints_file )
344
+ else str (constraints_file )
345
+ )
346
+
344
347
if not constraints_file .is_file ():
345
348
constraints_file .parent .mkdir (parents = True , exist_ok = True )
346
349
constraints_file .write_text ("" )
You can’t perform that action at this time.
0 commit comments