mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
[Fix] Fix symlink failure on Windows (#1038)
* fix symlink failure on Windows * fix develop mode on windows
This commit is contained in:
parent
a370777e3b
commit
24b4761d83
9
setup.py
9
setup.py
@ -1,6 +1,7 @@
|
||||
# Copyright (c) OpenMMLab. All rights reserved.
|
||||
import os
|
||||
import os.path as osp
|
||||
import platform
|
||||
import shutil
|
||||
import sys
|
||||
import warnings
|
||||
@ -109,10 +110,16 @@ def add_mim_extension():
|
||||
# parse installment mode
|
||||
if 'develop' in sys.argv:
|
||||
# installed by `pip install -e .`
|
||||
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 or \
|
||||
platform.system() == 'Windows':
|
||||
# installed by `pip install .`
|
||||
# or create source distribution by `python setup.py sdist`
|
||||
# set `copy` mode here since symlink fails with WinError on Windows.
|
||||
mode = 'copy'
|
||||
else:
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user