Skip to content

Commit 9b249db

Browse files
committed
Add windows paths for python exe and site-packages in wheel_builder.py
1 parent 8435e5f commit 9b249db

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pycross/private/tools/wheel_builder.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,9 @@ def check_filename_against_target(wheel_name: str, target_environment: TargetEnv
513513

514514
def find_site_dir(env_dir: Path) -> Path:
515515
lib_dir = env_dir / "lib"
516+
pattern = "site-packages" if "win32" == sys.platform else "python*/site-packages"
516517
try:
517-
return next(lib_dir.glob("python*/site-packages"))
518+
return next(lib_dir.glob(pattern))
518519
except StopIteration:
519520
raise ValueError(f"Cannot find site-packages under {env_dir}")
520521

@@ -628,8 +629,10 @@ def build_wheel(
628629
config_settings: Dict[str, str],
629630
debug: bool = False,
630631
) -> Path:
631-
python_exe = env_dir / "bin" / "python"
632-
632+
posix_python_exe = env_dir / "bin" / "python"
633+
win_python_exe = env_dir / "scripts" / "python.exe"
634+
python_exe = win_python_exe if "win32" == sys.platform else posix_python_exe
635+
633636
def _subprocess_runner(
634637
cmd: Sequence[str],
635638
cwd: Optional[str] = None,

0 commit comments

Comments
 (0)