Skip to content

Commit 5b96076

Browse files
committed
Do not try to regenerate symlinks on Windows as it just fails
1 parent 05953fa commit 5b96076

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

python/_build_backend/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import os
3737
from pathlib import Path
3838
import shutil
39+
import sys
3940

4041
from scikit_build_core.build import * # noqa: F401,F403
4142
from scikit_build_core.build import build_sdist as scikit_build_sdist
@@ -55,11 +56,12 @@ def prepare_licenses():
5556
try:
5657
yield
5758
finally:
58-
# Copy back the original symlinks so git status is clean.
59-
for name in LICENSE_FILES:
60-
filepath = PYTHON_DIR / name
61-
os.unlink(filepath)
62-
os.symlink(f"../{name}", filepath)
59+
if sys.platform != "win32":
60+
# Copy back the original symlinks so git status is clean.
61+
for name in LICENSE_FILES:
62+
filepath = PYTHON_DIR / name
63+
os.unlink(filepath)
64+
os.symlink(f"../{name}", filepath)
6365

6466

6567
def build_sdist(sdist_directory, config_settings=None):

0 commit comments

Comments
 (0)