Skip to content

Commit

Permalink
Catch symlink failure on Windows (#6482)
Browse files Browse the repository at this point in the history
* Catch symlink failure on Windows

Signed-off-by: del-zhenwu <dele.zhenwu@gmail.com>

* Set copy mode on Windows

Signed-off-by: del-zhenwu <dele.zhenwu@gmail.com>

* Fix lint

Signed-off-by: del-zhenwu <dele.zhenwu@gmail.com>

* Fix logic error

Signed-off-by: del-zhenwu <dele.zhenwu@gmail.com>
  • Loading branch information
del-zhenwu authored and ZwwWayne committed Nov 30, 2021
1 parent 8bb278a commit 65b0fa4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os
import os.path as osp
import platform
import shutil
import sys
import warnings
Expand Down Expand Up @@ -141,7 +142,11 @@ def add_mim_extension():
# parse installment mode
if 'develop' in sys.argv:
# 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:
# installed by `pip install .`
# or create source distribution by `python setup.py sdist`
Expand Down

0 comments on commit 65b0fa4

Please sign in to comment.