Make reflink optional

This commit is contained in:
Ruben De Smet 2017-07-31 17:00:11 +02:00
parent e1def7559e
commit 43f27506bf
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,6 @@ from beets.util import hidden
import six
from unidecode import unidecode
from enum import Enum
import reflink as pyreflink
MAX_FILENAME_LENGTH = 200
@ -554,6 +553,7 @@ def reflink(path, dest, replace=False, fallback=False):
`path` == `dest`. When `fallback` is True, `reflink` falls back on
`copy` when the filesystem does not support reflinks.
"""
import reflink as pyreflink
if samefile(path, dest):
return

View file

@ -93,7 +93,6 @@ setup(
'pyyaml',
'mediafile>=0.2.0',
'confuse>=1.0.0',
'reflink',
] + [
# Avoid a version of munkres incompatible with Python 3.
'munkres~=1.0.0' if sys.version_info < (3, 5, 0) else
@ -161,6 +160,7 @@ setup(
'scrub': ['mutagen>=1.33'],
'bpd': ['PyGObject'],
'replaygain': ['PyGObject'],
'reflink': ['reflink'],
},
# Non-Python/non-PyPI plugin dependencies:
# chroma: chromaprint or fpcalc