mirror of
https://github.com/borgbackup/borg.git
synced 2024-08-15 07:10:33 +03:00
remove algorithms package, move checksums module to borg package
This commit is contained in:
parent
c641e31e82
commit
cc3b5c062c
4
setup.py
4
setup.py
@ -94,7 +94,7 @@
|
||||
chunker_source = 'src/borg/chunker.pyx'
|
||||
hashindex_source = 'src/borg/hashindex.pyx'
|
||||
item_source = 'src/borg/item.pyx'
|
||||
checksums_source = 'src/borg/algorithms/checksums.pyx'
|
||||
checksums_source = 'src/borg/checksums.pyx'
|
||||
platform_posix_source = 'src/borg/platform/posix.pyx'
|
||||
platform_linux_source = 'src/borg/platform/linux.pyx'
|
||||
platform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'
|
||||
@ -207,7 +207,7 @@ def members_appended(*ds):
|
||||
Extension('borg.hashindex', [hashindex_source], extra_compile_args=cflags),
|
||||
Extension('borg.item', [item_source], extra_compile_args=cflags),
|
||||
Extension('borg.chunker', [chunker_source], extra_compile_args=cflags),
|
||||
Extension('borg.algorithms.checksums', **checksums_ext_kwargs),
|
||||
Extension('borg.checksums', **checksums_ext_kwargs),
|
||||
]
|
||||
|
||||
posix_ext = Extension('borg.platform.posix', [platform_posix_source], extra_compile_args=cflags)
|
||||
|
@ -1,6 +0,0 @@
|
||||
"""
|
||||
borg.algorithms
|
||||
===============
|
||||
|
||||
This package is intended for hash and checksum functions.
|
||||
"""
|
@ -36,7 +36,7 @@
|
||||
import borg
|
||||
from . import __version__
|
||||
from . import helpers
|
||||
from .algorithms.checksums import crc32
|
||||
from .checksums import crc32
|
||||
from .archive import Archive, ArchiveChecker, ArchiveRecreater, Statistics, is_special
|
||||
from .archive import BackupError, BackupOSError, backup_io, OsOpen, stat_update_check
|
||||
from .archive import FilesystemObjectProcessors, TarfileObjectProcessors, MetadataCollector, ChunksProcessor
|
||||
@ -563,7 +563,7 @@ def chunkit(chunker_name, *args, **kwargs):
|
||||
print(f"{spec:<24} {size:<10} {timeit(func, number=100):.3f}s")
|
||||
|
||||
import zlib
|
||||
from borg.algorithms.checksums import crc32, deflate_crc32, xxh64
|
||||
from borg.checksums import crc32, deflate_crc32, xxh64
|
||||
print("Non-cryptographic checksums / hashes ===========================")
|
||||
size = "1GB"
|
||||
tests = [
|
||||
|
@ -1,7 +1,7 @@
|
||||
import zlib
|
||||
|
||||
from ..platformflags import is_darwin
|
||||
from ..helpers import bin_to_hex
|
||||
from .platformflags import is_darwin
|
||||
from .helpers import bin_to_hex
|
||||
|
||||
from libc.stdint cimport uint32_t
|
||||
from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release
|
@ -6,7 +6,7 @@
|
||||
|
||||
from ..helpers import IntegrityError
|
||||
from ..logger import create_logger
|
||||
from ..algorithms.checksums import StreamingXXH64
|
||||
from ..checksums import StreamingXXH64
|
||||
|
||||
logger = create_logger()
|
||||
|
||||
|
@ -751,7 +751,7 @@ def format_needs_cache(cls, format):
|
||||
return any(key in cls.KEYS_REQUIRING_CACHE for key in format_keys)
|
||||
|
||||
def __init__(self, archive, format, *, json_lines=False):
|
||||
from ..algorithms.checksums import StreamingXXH64
|
||||
from ..checksums import StreamingXXH64
|
||||
self.xxh64 = StreamingXXH64
|
||||
self.archive = archive
|
||||
self.json_lines = json_lines
|
||||
|
@ -31,7 +31,7 @@
|
||||
from .helpers import msgpack
|
||||
from .repository import Repository
|
||||
from .version import parse_version, format_version
|
||||
from .algorithms.checksums import xxh64
|
||||
from .checksums import xxh64
|
||||
from .helpers.datastruct import EfficientCollectionQueue
|
||||
|
||||
logger = create_logger(__name__)
|
||||
|
@ -25,7 +25,7 @@
|
||||
from .logger import create_logger
|
||||
from .lrucache import LRUCache
|
||||
from .platform import SaveFile, SyncFile, sync_dir, safe_fadvise
|
||||
from .algorithms.checksums import crc32
|
||||
from .checksums import crc32
|
||||
from .crypto.file_integrity import IntegrityCheckedFile, FileIntegrityError
|
||||
|
||||
logger = create_logger(__name__)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from ..algorithms import checksums
|
||||
from .. import checksums
|
||||
from ..helpers import bin_to_hex
|
||||
|
||||
crc32_implementations = [checksums.deflate_crc32]
|
||||
|
Loading…
Reference in New Issue
Block a user