1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 17:27:31 +00:00

Merge pull request #5786 from ThomasWaldmann/no-distutils-but-packaging-master

get rid of distutils, using packaging
This commit is contained in:
TW 2021-05-01 21:27:25 +02:00 committed by GitHub
commit 76063ab219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 15 deletions

View file

@ -63,9 +63,9 @@ jobs:
- os: ubuntu-20.04
python-version: '3.9'
toxenv: py39-fuse3
#- os: ubuntu-20.04
# python-version: '3.10-dev'
# toxenv: py310-fuse3
- os: ubuntu-20.04
python-version: '3.10-dev'
toxenv: py310-fuse3
- os: macos-latest
# note: it seems that 3.8 and 3.9 are currently broken,
# neverending RuntimeError crashes...

View file

@ -11,9 +11,8 @@
multiprocessing = None
from setuptools.command.build_ext import build_ext
from setuptools import setup, find_packages, Extension
from setuptools import setup, find_packages, Extension, Command
from setuptools.command.sdist import sdist
from distutils.command.clean import clean
try:
from Cython.Build import cythonize
@ -71,6 +70,7 @@
# Please note:
# using any other version is not supported by borg development and
# any feedback related to issues caused by this will be ignored.
'packaging',
]
# note for package maintainers: if you package borgbackup for distribution,
@ -137,9 +137,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_sources:
genc = source.replace('.pyx', '.c')
rm(genc)
@ -153,7 +160,7 @@ def run(self):
'build_usage': setup_docs.build_usage,
'build_man': setup_docs.build_man,
'sdist': Sdist,
'clean': Clean,
'clean2': Clean,
}
ext_modules = []
@ -220,8 +227,8 @@ def members_appended(*ds):
# sometimes there's no need to cythonize
# this breaks chained commands like 'clean sdist'
cythonizing = len(sys.argv) > 1 and sys.argv[1] not in ('clean', 'egg_info', '--help-commands', '--version') \
and '--help' not in sys.argv[1:]
cythonizing = len(sys.argv) > 1 and sys.argv[1] not in (
('clean', 'clean2', 'egg_info', '--help-commands', '--version')) and '--help' not in sys.argv[1:]
if cythonize and cythonizing:
cython_opts = dict(

View file

@ -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
# being 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

View file

@ -7,7 +7,7 @@
import sys
import tempfile
from distutils.version import LooseVersion
from packaging.version import parse as parse_version
from .helpers import prepare_subprocess_env
@ -29,8 +29,8 @@
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