1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
Index: h5py/setup_build.py
===================================================================
--- h5py.orig/setup_build.py 2025-11-01 20:45:27.341039112 +0100
+++ h5py/setup_build.py 2025-11-01 20:47:30.850296350 +0100
@@ -20,6 +20,8 @@
import api_gen
from setup_configure import BuildConfig
+# set flavour to 'pre_h5py_suf' to enable alternative builds e.g. _debian_h5py_mpi
+flavour=''
def localpath(*args):
return op.abspath(op.join(op.dirname(__file__), *args))
@@ -121,7 +123,7 @@
#settings['runtime_library_dirs'] = settings['library_dirs']
for module in ALL_MODULES:
- raw_path = Path(localpath("h5py")).joinpath(module).resolve()
+ raw_path = Path(localpath("h5py", flavour)).joinpath(module).resolve()
for ext in ['.pyx', '.pxd', '.pxi']:
if not (templ := raw_path.with_suffix(f'.templ{ext}')).exists():
continue
@@ -147,11 +149,15 @@
@staticmethod
def _make_extension(module, settings):
- sources = [localpath('h5py', module + '.pyx')] + EXTRA_SRC.get(module, [])
+ sources = [localpath('h5py', flavour, module+'.pyx')] + EXTRA_SRC.get(module, [])
settings = copy.deepcopy(settings)
settings['libraries'] += EXTRA_LIBRARIES.get(module, [])
- return Extension('h5py.' + module, sources, **settings)
+ if flavour:
+ h5py_module='h5py'+'.'+flavour+'.'+module
+ else:
+ h5py_module='h5py'+'.'+module
+ return Extension(h5py_module, sources, **settings)
def run(self):
""" Distutils calls this method to run the command """
@@ -181,7 +187,7 @@
# Refresh low-level defs if missing or stale
print("Executing api_gen rebuild of defs")
- api_gen.run()
+ api_gen.run(flavour=flavour)
templ_config = {
"MPI": bool(config.mpi),
Index: h5py/api_gen.py
===================================================================
--- h5py.orig/api_gen.py 2025-11-01 20:45:27.341039112 +0100
+++ h5py/api_gen.py 2025-11-01 20:45:27.337486404 +0100
@@ -182,15 +182,15 @@
def __init__(self, config) -> None:
self.config = config
- def run(self):
+ def run(self, flavour=''):
# Function definitions file
- self.functions = Path('h5py', 'api_functions.txt').open('r')
+ self.functions = Path('h5py', flavour, 'api_functions.txt').open('r')
# Create output files
- path_raw_defs = Path('h5py', '_hdf5.pxd.new')
- path_cython_defs = Path('h5py', 'defs.pxd.new')
- path_cython_imp = Path('h5py', 'defs.pyx.new')
+ path_raw_defs = Path('h5py', flavour, '_hdf5.pxd.new')
+ path_cython_defs = Path('h5py', flavour, 'defs.pxd.new')
+ path_cython_imp = Path('h5py', flavour, 'defs.pyx.new')
self.raw_defs = path_raw_defs.open('w')
self.cython_defs = path_cython_defs.open('w')
self.cython_imp = path_cython_imp.open('w')
@@ -312,11 +312,11 @@
self.cython_imp.write(imp)
-def run():
+def run(flavour=''):
# Get configuration from environment variables
config = BuildConfig.from_env()
lp = LineProcessor(config)
- lp.run()
+ lp.run(flavour=flavour)
if __name__ == '__main__':
|