mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
Merge pull request #3135 from rxxg/master
Perf improvement for file copies
This commit is contained in:
+18
-3
@@ -1,14 +1,31 @@
|
||||
import errno
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
|
||||
from dvc.compat import fspath
|
||||
from dvc.exceptions import DvcException
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if platform.system() == "Windows":
|
||||
try:
|
||||
import speedcopy
|
||||
|
||||
speedcopy.patch_copyfile()
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
try:
|
||||
# Importing the module monkey-patches shutil.copyfile
|
||||
import pyfastcopy # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class System(object):
|
||||
@staticmethod
|
||||
@@ -90,8 +107,6 @@ class System(object):
|
||||
|
||||
@staticmethod
|
||||
def reflink(source, link_name):
|
||||
import platform
|
||||
|
||||
source, link_name = fspath(source), fspath(link_name)
|
||||
|
||||
system = platform.system()
|
||||
|
||||
Reference in New Issue
Block a user