Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
- os: ubuntu-20.04
python-version: '3.9'
toxenv: py39
#- os: ubuntu-20.04
# python-version: '3.10-dev'
# toxenv: py310
- os: ubuntu-20.04
python-version: '3.10-dev'
toxenv: py310
- os: macos-latest
# note: it seems that 3.8 and 3.9 are currently broken,
# neverending RuntimeError crashes...
Expand Down
23 changes: 15 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
# Are we building on ReadTheDocs?
on_rtd = os.environ.get('READTHEDOCS')

install_requires = []
install_requires = [
'packaging',
]

# note for package maintainers: if you package borgbackup for distribution,
# please add llfuse as a *requirement* on all platforms that have a working
Expand All @@ -52,10 +54,8 @@
],
}

from setuptools import setup, find_packages, Extension
from setuptools import setup, find_packages, Extension, Command
from setuptools.command.sdist import sdist
from distutils.core import Command
from distutils.command.clean import clean

compress_source = 'src/borg/compress.pyx'
crypto_ll_source = 'src/borg/crypto/low_level.pyx'
Expand Down Expand Up @@ -146,7 +146,7 @@ def __init__(self, *args, **kwargs):
msgpack_packer_source = msgpack_packer_source.replace('.pyx', '.cpp')
msgpack_unpacker_source = msgpack_unpacker_source.replace('.pyx', '.cpp')

from distutils.command.build_ext import build_ext
from setuptools.command.build_ext import build_ext
if not on_rtd and not all(os.path.exists(path) for path in [
compress_source, crypto_ll_source, chunker_source, hashindex_source, item_source, checksums_source,
platform_posix_source, platform_linux_source, platform_syncfilerange_source, platform_freebsd_source, platform_darwin_source,
Expand Down Expand Up @@ -767,9 +767,16 @@ def rm(file):
pass


class Clean(clean):
class Clean(Command):
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
super().run()
for source in cython_c_sources:
genc = source.replace('.pyx', '.c')
rm(genc)
Expand All @@ -786,7 +793,7 @@ def run(self):
'build_usage': build_usage,
'build_man': build_man,
'sdist': Sdist,
'clean': Clean,
'clean2': Clean,
}

ext_modules = []
Expand Down
5 changes: 3 additions & 2 deletions src/borg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from distutils.version import LooseVersion
from packaging.version import parse as parse_version

# IMPORTANT keep imports from borg here to a minimum because our testsuite depends on
# beeing able to import borg.constants and then monkey patching borg.constants.PBKDF2_ITERATIONS
from ._version import version as __version__


__version_tuple__ = tuple(LooseVersion(__version__).version[:3])
_v = parse_version(__version__)
__version_tuple__ = _v._version.release

# assert that all semver components are integers
# this is mainly to show errors when people repackage poorly
Expand Down
6 changes: 3 additions & 3 deletions src/borg/xattr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tempfile
from ctypes import CDLL, create_string_buffer, c_ssize_t, c_size_t, c_char_p, c_int, c_uint32, get_errno
from ctypes.util import find_library
from distutils.version import LooseVersion
from packaging.version import parse as parse_version

from .helpers import Buffer, prepare_subprocess_env

Expand Down Expand Up @@ -90,8 +90,8 @@ def get_all(path, follow_symlinks=True):
if preload.startswith("libfakeroot"):
env = prepare_subprocess_env(system=True)
fakeroot_output = subprocess.check_output(['fakeroot', '-v'], env=env)
fakeroot_version = LooseVersion(fakeroot_output.decode('ascii').split()[-1])
if fakeroot_version >= LooseVersion("1.20.2"):
fakeroot_version = parse_version(fakeroot_output.decode('ascii').split()[-1])
if fakeroot_version >= parse_version("1.20.2"):
# 1.20.2 has been confirmed to have xattr support
# 1.18.2 has been confirmed not to have xattr support
# Versions in-between are unknown
Expand Down