2
0
Эх сурвалжийг харах

moved bundled_path to setup_*.py

Thomas Waldmann 6 жил өмнө
parent
commit
24bf01a40b
4 өөрчлөгдсөн 15 нэмэгдсэн , 14 устгасан
  1. 3 8
      setup.py
  2. 4 2
      setup_b2.py
  3. 4 2
      setup_lz4.py
  4. 4 2
      setup_zstd.py

+ 3 - 8
setup.py

@@ -143,17 +143,12 @@ cmdclass = {
 ext_modules = []
 if not on_rtd:
     compress_ext_kwargs = dict(sources=[compress_source])
-    compress_ext_kwargs = setup_lz4.lz4_ext_kwargs(bundled_path='src/borg/algorithms/lz4',
-                                                   prefer_system=prefer_system_liblz4,
-                                                   **compress_ext_kwargs)
-    compress_ext_kwargs = setup_zstd.zstd_ext_kwargs(bundled_path='src/borg/algorithms/zstd',
-                                                     prefer_system=prefer_system_libzstd,
+    compress_ext_kwargs = setup_lz4.lz4_ext_kwargs(prefer_system_liblz4, **compress_ext_kwargs)
+    compress_ext_kwargs = setup_zstd.zstd_ext_kwargs(prefer_system_libzstd,
                                                      multithreaded=False, legacy=False, **compress_ext_kwargs)
     crypto_ext_kwargs = dict(sources=[crypto_ll_source, crypto_helpers])
     crypto_ext_kwargs = setup_crypto.crypto_ext_kwargs(**crypto_ext_kwargs)
-    crypto_ext_kwargs = setup_b2.b2_ext_kwargs(bundled_path='src/borg/algorithms/blake2',
-                                               prefer_system=prefer_system_libb2,
-                                               **crypto_ext_kwargs)
+    crypto_ext_kwargs = setup_b2.b2_ext_kwargs(prefer_system_libb2, **crypto_ext_kwargs)
     ext_modules += [
         Extension('borg.compress', **compress_ext_kwargs),
         Extension('borg.crypto.low_level', **crypto_ext_kwargs),

+ 4 - 2
setup_b2.py

@@ -11,6 +11,9 @@ import os
 
 # b2 files, structure as seen in BLAKE2 (reference implementation) project repository:
 
+# bundled_path: relative (to this file) path to the bundled library source code files
+bundled_path = 'src/borg/algorithms/blake2'
+
 b2_sources = [
     'ref/blake2b-ref.c',
 ]
@@ -20,10 +23,9 @@ b2_includes = [
 ]
 
 
-def b2_ext_kwargs(bundled_path, prefer_system, **kwargs):
+def b2_ext_kwargs(prefer_system, **kwargs):
     """amend kwargs with b2 stuff for a distutils.extension.Extension initialization.
 
-    bundled_path: relative (to this file) path to the bundled library source code files
     prefer_system: prefer the system-installed library (if found) over the bundled C code
     kwargs: distutils.extension.Extension kwargs that should be amended
     returns: amended kwargs

+ 4 - 2
setup_lz4.py

@@ -11,6 +11,9 @@ import os
 
 # lz4 files, structure as seen in lz4 project repository:
 
+# bundled_path: relative (to this file) path to the bundled library source code files
+bundled_path = 'src/borg/algorithms/lz4'
+
 lz4_sources = [
     'lib/lz4.c',
 ]
@@ -20,10 +23,9 @@ lz4_includes = [
 ]
 
 
-def lz4_ext_kwargs(bundled_path, prefer_system, **kwargs):
+def lz4_ext_kwargs(prefer_system, **kwargs):
     """amend kwargs with lz4 stuff for a distutils.extension.Extension initialization.
 
-    bundled_path: relative (to this file) path to the bundled library source code files
     prefer_system: prefer the system-installed library (if found) over the bundled C code
     kwargs: distutils.extension.Extension kwargs that should be amended
     returns: amended kwargs

+ 4 - 2
setup_zstd.py

@@ -11,6 +11,9 @@ import os
 
 # zstd files, structure as seen in zstd project repository:
 
+# bundled_path: relative (to this file) path to the bundled library source code files
+bundled_path = 'src/borg/algorithms/zstd'
+
 zstd_sources = [
     'lib/common/debug.c',
     'lib/common/entropy_common.c',
@@ -67,10 +70,9 @@ zstd_includes_legacy = [
 ]
 
 
-def zstd_ext_kwargs(bundled_path, prefer_system, multithreaded=False, legacy=False, **kwargs):
+def zstd_ext_kwargs(prefer_system, multithreaded=False, legacy=False, **kwargs):
     """amend kwargs with zstd suff for a distutils.extension.Extension initialization.
 
-    bundled_path: relative (to this file) path to the bundled library source code files
     prefer_system: prefer the system-installed library (if found) over the bundled C code
     multithreaded: True: define ZSTD_MULTITHREAD
     legacy: include legacy API support