mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 09:59:19 -04:00
Merge pull request #5847 from ThomasWaldmann/no-distutils-but-packaging-1.1
No distutils but packaging (backport to 1.1)
This commit is contained in:
commit
6742d9e5e4
4 changed files with 24 additions and 16 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
|
@ -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...
|
||||
|
|
|
|||
23
setup.py
23
setup.py
|
|
@ -37,7 +37,9 @@ if my_python < min_python:
|
|||
# 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
|
||||
|
|
@ -52,10 +54,8 @@ extras_require = {
|
|||
],
|
||||
}
|
||||
|
||||
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'
|
||||
|
|
@ -146,7 +146,7 @@ except ImportError:
|
|||
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,
|
||||
|
|
@ -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)
|
||||
|
|
@ -786,7 +793,7 @@ cmdclass = {
|
|||
'build_usage': build_usage,
|
||||
'build_man': build_man,
|
||||
'sdist': Sdist,
|
||||
'clean': Clean,
|
||||
'clean2': Clean,
|
||||
}
|
||||
|
||||
ext_modules = []
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import sys
|
|||
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
|
||||
|
||||
|
|
@ -90,8 +90,8 @@ if sys.platform.startswith('linux'):
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue