Unverified Commit bdb30325 authored by Wenhao Wu's avatar Wenhao Wu Committed by GitHub
Browse files

[Fix] Catch symlink failure on Windows (#1096)

parent 940e4294
from setuptools import find_packages, setup from setuptools import find_packages, setup
import os import os
import platform
import shutil import shutil
import sys import sys
import torch import torch
...@@ -150,7 +151,11 @@ def add_mim_extention(): ...@@ -150,7 +151,11 @@ def add_mim_extention():
# parse installment mode # parse installment mode
if 'develop' in sys.argv: if 'develop' in sys.argv:
# installed by `pip install -e .` # installed by `pip install -e .`
mode = 'symlink' if platform.system() == 'Windows':
# set `copy` mode here since symlink fails on Windows.
mode = 'copy'
else:
mode = 'symlink'
elif 'sdist' in sys.argv or 'bdist_wheel' in sys.argv: elif 'sdist' in sys.argv or 'bdist_wheel' in sys.argv:
# installed by `pip install .` # installed by `pip install .`
# or create source distribution by `python setup.py sdist` # or create source distribution by `python setup.py sdist`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment