From 34cadfdc4e38d8dfb79738886b36cf53cf376b5b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 4 Sep 2023 23:16:20 +0200 Subject: [PATCH 1/4] pyproject.toml: move pytest options --- pyproject.toml | 6 ++++++ setup.cfg | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6912a82e7..19c37ded1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,3 +67,9 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" "src/borg/testsuite/archiver/return_codes.py" = ["F811"] "src/borg/testsuite/benchmark.py" = ["F811"] "src/borg/testsuite/platform.py" = ["F811"] + +[tool.pytest.ini_options] +python_files = "testsuite/*.py" +markers = [ + "allow_cache_wipe", +] diff --git a/setup.cfg b/setup.cfg index afe4e95a9..112dfb714 100644 --- a/setup.cfg +++ b/setup.cfg @@ -69,11 +69,6 @@ llfuse = llfuse >= 1.3.8 pyfuse3 = pyfuse3 >= 3.1.1 nofuse = -[tool:pytest] -python_files = testsuite/*.py -markers = - allow_cache_wipe - [mypy] python_version = 3.9 strict_optional = False From a91b7d2787978c12c1fdff137954cd65073d9c2f Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 4 Sep 2023 23:27:10 +0200 Subject: [PATCH 2/4] pyproject.toml: move mypy options --- pyproject.toml | 18 ++++++++++++++++++ setup.cfg | 21 --------------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 19c37ded1..9df541149 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,3 +73,21 @@ python_files = "testsuite/*.py" markers = [ "allow_cache_wipe", ] + +[tool.mypy] +python_version = "3.9" +strict_optional = false +local_partial_types = true +show_error_codes = true +files = "src/borg/**/*.py" + +[[tool.mypy.overrides]] +module = [ + "msgpack.*", + "llfuse", + "pyfuse3", + "trio", + "borg.crypto.low_level", + "borg.platform.*", +] +ignore_missing_imports = true diff --git a/setup.cfg b/setup.cfg index 112dfb714..3f8c92a0f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -68,24 +68,3 @@ console_scripts = llfuse = llfuse >= 1.3.8 pyfuse3 = pyfuse3 >= 3.1.1 nofuse = - -[mypy] -python_version = 3.9 -strict_optional = False -local_partial_types = True -show_error_codes = True -files = src/borg/**/*.py - -[mypy-msgpack.*] -ignore_missing_imports = True -[mypy-llfuse] -ignore_missing_imports = True -[mypy-pyfuse3] -ignore_missing_imports = True -[mypy-trio] -ignore_missing_imports = True - -[mypy-borg.crypto.low_level] -ignore_missing_imports = True -[mypy-borg.platform.*] -ignore_missing_imports = True From 61e96eb51f6c17452ff3a506e2187d20ca5d204f Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 5 Sep 2023 00:01:40 +0200 Subject: [PATCH 3/4] pyproject.toml: move project metadata --- pyproject.toml | 54 ++++++++++++++++++++++++++++++++++++++ setup.cfg | 70 -------------------------------------------------- 2 files changed, 54 insertions(+), 70 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 9df541149..587df1309 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,57 @@ +[project] +name = "borgbackup" +dynamic = ["version"] +authors = [{name="The Borg Collective (see AUTHORS file)"}] +maintainers = [ + {name="Thomas Waldmann", email="tw@waldmann-edv.de"}, +] +description = "Deduplicated, encrypted, authenticated and compressed backups" +readme = "README.rst" +requires-python = ">=3.9" +keywords = ["backup", "borgbackup"] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: BSD License", + "Operating System :: POSIX :: BSD :: FreeBSD", + "Operating System :: POSIX :: BSD :: OpenBSD", + "Operating System :: POSIX :: BSD :: NetBSD", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Security :: Cryptography", + "Topic :: System :: Archiving :: Backup", +] +license = {text="BSD"} +dependencies = [ + "msgpack >=1.0.3, <=1.0.5", + "packaging", + "platformdirs >=3.0.0, <4.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0, + "platformdirs >=2.6.0, <4.0.0; sys_platform != 'darwin'", # for others: 2.6+ works consistently. + "argon2-cffi", +] + +[project.optional-dependencies] +llfuse = ["llfuse >= 1.3.8"] +pyfuse3 = ["pyfuse3 >= 3.1.1"] +nofuse = [] + +[project.urls] +"Homepage" = "https://borgbackup.org/" +"Bug Tracker" = "https://github.com/borgbackup/borg/issues" +"Documentation" = "https://borgbackup.readthedocs.io/" +"Repository" = "https://github.com/borgbackup/borg" +"Changelog" = "https://github.com/borgbackup/borg/blob/master/docs/changes.rst" + +[project.scripts] +borg = "borg.archiver:main" +borgfs = "borg.archiver:main" + [build-system] requires = ["setuptools", "pkgconfig", "Cython", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3f8c92a0f..000000000 --- a/setup.cfg +++ /dev/null @@ -1,70 +0,0 @@ -[metadata] -name = borgbackup -author = The Borg Collective (see AUTHORS file) -description = Deduplicated, encrypted, authenticated and compressed backups -url = https://borgbackup.org -keywords = - backup - borgbackup -classifiers = - Development Status :: 4 - Beta - Environment :: Console - Intended Audience :: System Administrators - License :: OSI Approved :: BSD License - Operating System :: POSIX :: BSD :: FreeBSD - Operating System :: POSIX :: BSD :: OpenBSD - Operating System :: POSIX :: BSD :: NetBSD - Operating System :: MacOS :: MacOS X - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Security :: Cryptography - Topic :: System :: Archiving :: Backup -platforms = Linux, MacOS X, FreeBSD, OpenBSD, NetBSD -license = BSD -license_files = LICENSE -project_urls = - Bug Tracker = https://github.com/borgbackup/borg/issues - Documentation = https://borgbackup.readthedocs.io - Source Code = https://github.com/borgbackup/borg - -[options] -packages = find_namespace: -package_dir = - =src -python_requires = >=3.9 -install_requires = - msgpack >=1.0.3, <=1.0.5 - packaging - platformdirs >=3.0.0, <4.0.0; sys_platform == 'darwin' # for macOS: breaking changes in 3.0.0, - platformdirs >=2.6.0, <4.0.0; sys_platform != 'darwin' # for others: 2.6+ works consistently. - argon2-cffi -tests_require = - pytest -zip_safe = False -# See also the MANIFEST.in file. -# We want to install all the files in the package directories... -include_package_data = true - -# ...except the source files which have been compiled (C extensions): -[options.exclude_package_data] -* = - *.c - *.h - *.pyx - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - borg = borg.archiver:main - borgfs = borg.archiver:main - -[options.extras_require] -llfuse = llfuse >= 1.3.8 -pyfuse3 = pyfuse3 >= 3.1.1 -nofuse = From 55f0798b15ff8d1410d1e7af06376bbcfba1fa52 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 5 Sep 2023 00:34:03 +0200 Subject: [PATCH 4/4] fix src code formatting not sure why this changed!? --- src/borg/helpers/msgpack.py | 4 ++-- src/borg/manifest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/borg/helpers/msgpack.py b/src/borg/helpers/msgpack.py index dce6eb33f..54c3b9cbd 100644 --- a/src/borg/helpers/msgpack.py +++ b/src/borg/helpers/msgpack.py @@ -84,7 +84,7 @@ def __init__( use_single_float=False, autoreset=True, use_bin_type=USE_BIN_TYPE, - strict_types=False + strict_types=False, ): assert unicode_errors == UNICODE_ERRORS super().__init__( @@ -133,7 +133,7 @@ def __init__( unicode_errors=UNICODE_ERRORS, max_buffer_size=0, ext_hook=ExtType, - strict_map_key=False + strict_map_key=False, ): assert raw == RAW assert unicode_errors == UNICODE_ERRORS diff --git a/src/borg/manifest.py b/src/borg/manifest.py index 0768ce44c..a9609884e 100644 --- a/src/borg/manifest.py +++ b/src/borg/manifest.py @@ -113,7 +113,7 @@ def list( older=None, newer=None, oldest=None, - newest=None + newest=None, ): """ Return list of ArchiveInfo instances according to the parameters.