File tree 4 files changed +14
-7
lines changed
4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -438,8 +438,8 @@ def build(options: Options, tmp_path: Path) -> None:
438
438
constraints_path = build_options .dependency_constraints .get_for_python_version (
439
439
version = config .version , tmp_dir = identifier_tmp_dir
440
440
)
441
- dependency_constraint_flags : Sequence [ PathOrStr ] = (
442
- ["-c" , constraints_path ] if constraints_path else []
441
+ dependency_constraint_flags = (
442
+ ["-c" , constraints_path . as_uri () ] if constraints_path else []
443
443
)
444
444
445
445
base_python , env = setup_python (
Original file line number Diff line number Diff line change @@ -269,8 +269,8 @@ def build(options: Options, tmp_path: Path) -> None:
269
269
constraints_path = build_options .dependency_constraints .get_for_python_version (
270
270
version = config .version , variant = "pyodide" , tmp_dir = identifier_tmp_dir
271
271
)
272
- dependency_constraint_flags : Sequence [ PathOrStr ] = (
273
- ["-c" , constraints_path ] if constraints_path else []
272
+ dependency_constraint_flags = (
273
+ ["-c" , constraints_path . as_uri () ] if constraints_path else []
274
274
)
275
275
276
276
env = setup_python (
Original file line number Diff line number Diff line change @@ -370,8 +370,8 @@ def build(options: Options, tmp_path: Path) -> None:
370
370
version = config .version ,
371
371
tmp_dir = identifier_tmp_dir ,
372
372
)
373
- dependency_constraint_flags : Sequence [ PathOrStr ] = (
374
- ["-c" , constraints_path ] if constraints_path else []
373
+ dependency_constraint_flags = (
374
+ ["-c" , constraints_path . as_uri () ] if constraints_path else []
375
375
)
376
376
377
377
# install Python
Original file line number Diff line number Diff line change 4
4
import shutil
5
5
import sys
6
6
import tomllib
7
+ import urllib .parse
7
8
from collections .abc import Sequence
8
9
from pathlib import Path
9
10
from typing import Final
@@ -51,7 +52,13 @@ def _parse_pip_constraint_for_virtualenv(
51
52
assert len (dependency_constraint_flags ) in {0 , 2 }
52
53
if len (dependency_constraint_flags ) == 2 :
53
54
assert dependency_constraint_flags [0 ] == "-c"
54
- constraint_path = Path (dependency_constraint_flags [1 ])
55
+ dep_c = dependency_constraint_flags [1 ]
56
+ # Path.from_uri added in 3.13
57
+ constraint_path = (
58
+ Path (urllib .parse .unquote (urllib .parse .urlparse (dep_c ).path ))
59
+ if isinstance (dep_c , str ) and dep_c .startswith ("file:" )
60
+ else Path (dep_c )
61
+ )
55
62
assert constraint_path .exists ()
56
63
with constraint_path .open (encoding = "utf-8" ) as constraint_file :
57
64
for line_ in constraint_file :
You can’t perform that action at this time.
0 commit comments