Skip to content

Commit 83ea16e

Browse files
Drop another ValueError
1 parent bce7bb6 commit 83ea16e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pyodide_build/build_env.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,16 @@ def _create_constraints_file() -> str:
334334
if not constraints:
335335
return ""
336336

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.
343340
constraints_file = Path(constraints)
341+
constraints = (
342+
constraints_file.as_uri()
343+
if " " in str(constraints_file)
344+
else str(constraints_file)
345+
)
346+
344347
if not constraints_file.is_file():
345348
constraints_file.parent.mkdir(parents=True, exist_ok=True)
346349
constraints_file.write_text("")

0 commit comments

Comments
 (0)