Skip to content

Commit e6321f1

Browse files
jswhit2jswhit2
authored andcommitted
update
1 parent 312a024 commit e6321f1

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test-command = [
122122
]
123123
manylinux-x86_64-image = "ghcr.io/ocefpaf/manylinux_2_28_x86_64-netcdf"
124124
manylinux-aarch64-image = "ghcr.io/ocefpaf/manylinux_2_28_aarch64-netcdf"
125-
environment = {NETCDF4_LIMITED_API="1"}
125+
environment = {NETCDF4_LIMITED_API="1", NETCDF_PLUGIN_DIR="/usr/local/hdf5/lib/plugin/"}
126126

127127
[tool.cibuildwheel.macos]
128128
before-build = "brew install hdf5 netcdf"

src/netCDF4/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# init for netCDF4. package
2+
# if HDF5_PLUGIN_PATH not set, point to package path if plugins live there
3+
import os
4+
pluginpath = os.path.join(__path__[0],'plugins')
5+
if 'HDF5_PLUGIN_PATH' not in os.environ and\
6+
(os.path.exists(os.path.join(pluginpath,'lib__nczhdf5filters.so')) or\
7+
os.path.exists(os.path.join(pluginpath,'lib__nczhdf5filters.dll')) or\
8+
os.path.exists(os.path.join(pluginpath,'lib__nczhdf5filters.dylib'))):
9+
os.environ['HDF5_PLUGIN_PATH']=pluginpath
210
# Docstring comes from extension module _netCDF4.
311
from ._netCDF4 import *
412
# Need explicit imports for names beginning with underscores
@@ -11,17 +19,10 @@
1119
__has_quantization_support__, __has_zstandard_support__,
1220
__has_bzip2_support__, __has_blosc_support__, __has_szip_support__,
1321
__has_set_alignment__, __has_parallel_support__, __has_ncfilter__, __has_nc_rc_set__)
14-
import os
1522
__all__ = [
1623
'Dataset', 'Variable', 'Dimension', 'Group', 'MFDataset', 'MFTime', 'CompoundType',
1724
'VLType', 'date2num', 'num2date', 'date2index', 'stringtochar', 'chartostring',
1825
'stringtoarr', 'getlibversion', 'EnumType', 'get_chunk_cache', 'set_chunk_cache',
1926
'set_alignment', 'get_alignment', 'rc_get', 'rc_set',
2027
]
2128
__pdoc__ = {'utils': False}
22-
# if HDF5_PLUGIN_PATH not set, point to package path if plugins live there
23-
pluginpath = os.path.join(__path__[0],'plugins')
24-
if 'HDF5_PLUGIN_PATH' not in os.environ and\
25-
(os.path.exists(os.path.join(pluginpath,'lib__nczhdf5filters.so')) or\
26-
os.path.exists(os.path.join(pluginpath,'lib__nczhdf5filters.dylib'))):
27-
os.environ['HDF5_PLUGIN_PATH']=pluginpath

test/run_all.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
m = __import__(os.path.splitext(f)[0])
1616
testsuite.addTests(unittest.TestLoader().loadTestsFromModule(m))
1717

18-
# skip compression plugin tests on windows for now
19-
# (conda package plugins not working?).
20-
if sys.platform == 'win32':
21-
test_files.remove('tst_compression_zstd.py')
22-
test_files.remove('tst_compression_blosc.py')
23-
test_files.remove('tst_compression_bzip2.py')
24-
2518
if __name__ == '__main__':
2619
import numpy, cython
2720
sys.stdout.write('\n')

0 commit comments

Comments
 (0)