Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use of system blosc2 to build pytables #987

Merged
merged 3 commits into from Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -45,3 +45,39 @@ jobs:
ptrepack -h
ptdump -h
pttree -h


build_cblosc:
name: Sdist with cblosc2
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
- name: Install dependencies
run: |
conda install setuptools pip wheel build packaging py-cpuinfo numpy cython numexpr bzip2 hdf5 lzo 'typing_extensions<4.2' c-blosc2
- name: Source distribution
run: |
python -m build --sdist
- name: Installation
run: |
pip install -v dist/*.tar.gz --no-deps
- name: 'Run test'
run: |
cd .. && python -m tables.tests.test_all -v
pt2to3 -h
ptrepack -h
ptdump -h
pttree -h
17 changes: 12 additions & 5 deletions setup.py
Expand Up @@ -262,18 +262,25 @@ def run(self):

debug = "--debug" in sys.argv

blosc2_inc, blosc2_lib = get_blosc2_directories()

# Global variables
lib_dirs = [blosc2_lib]
inc_dirs = [Path("hdf5-blosc/src"), Path("hdf5-blosc2/src"), blosc2_inc]
lib_dirs = []
inc_dirs = [Path("hdf5-blosc/src"), Path("hdf5-blosc2/src")]
optional_libs = []
copy_libs = []

default_header_dirs = None
default_library_dirs = None
default_runtime_dirs = None

blosc2_inc = blosc2_lib = None
if os.environ.get("PYTABLES_NO_BLOASC2_WHEEL", None) is None:
avalentino marked this conversation as resolved.
Show resolved Hide resolved
try:
blosc2_inc, blosc2_lib = get_blosc2_directories()
lib_dirs.append(blosc2_lib)
inc_dirs.append(blosc2_inc)
except EnvironmentError:
pass

if os.name == "posix":
prefixes = ("/usr/local", "/sw", "/opt", "/opt/local", "/usr", "/")
prefix_paths = [Path(x) for x in prefixes]
Expand Down Expand Up @@ -691,7 +698,7 @@ def find_runtime_path(self, locations=default_runtime_dirs):
# Try to locate the compulsory and optional libraries.
lzo2_enabled = False
compiler = new_compiler()
if not BLOSC2_DIR:
if not BLOSC2_DIR and blosc2_inc is not None:
# Inject the blosc2 directory as detected
BLOSC2_DIR = os.path.dirname(blosc2_inc)
for (package, location) in [
Expand Down