diff --git a/conda/pytables/LICENSE.txt b/conda/pytables/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..5f302793a84a7e5bf79abee2e013e1673a118f0a --- /dev/null +++ b/conda/pytables/LICENSE.txt @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2020, conda-forge contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/conda/pytables/bld.bat b/conda/pytables/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..64693bcd5ecdac7b1607831b8b8a9f3af12b2424 --- /dev/null +++ b/conda/pytables/bld.bat @@ -0,0 +1,9 @@ +set HDF5_DIR=%LIBRARY_PREFIX% +set BZIP2_DIR=%LIBRARY_PREFIX% + +%PYTHON% setup.py install --hdf5=%LIBRARY_PREFIX% ^ + --bzip2=%LIBRARY_PREFIX% ^ + --lzo=%LIBRARY_PREFIX% ^ + --blosc=%LIBRARY_PREFIX% ^ + --single-version-externally-managed --record record.txt +if errorlevel 1 exit 1 diff --git a/conda/pytables/build.sh b/conda/pytables/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d03368372bc0b156e56068bae26f7688bb8718a7 --- /dev/null +++ b/conda/pytables/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +export BZIP2_DIR=$PREFIX +export HDF5_DIR=$PREFIX +export LZO_DIR=$PREFIX +export BLOSC_DIR=$PREFIX + +$PYTHON -m pip install --no-deps --no-cache-dir --ignore-installed . diff --git a/conda/pytables/do_not_copy_dlls_into_package.patch b/conda/pytables/do_not_copy_dlls_into_package.patch new file mode 100644 index 0000000000000000000000000000000000000000..3325349f20685e1b0031d585e3448c0700738ed1 --- /dev/null +++ b/conda/pytables/do_not_copy_dlls_into_package.patch @@ -0,0 +1,17 @@ +diff --git a/setup.py b/setup.py +index 5020d0a..1dfca70 100755 +--- a/setup.py ++++ b/setup.py +@@ -817,12 +817,6 @@ if __name__ == '__main__': + + name = find_name() + +- if os.name == "nt": +- # Add DLL's to the final package for windows +- data_files.extend([ +- ('Lib/site-packages/%s' % name, dll_files), +- ]) +- + ADDLIBS = [hdf5_package.library_name] + + # List of Blosc file dependencies diff --git a/conda/pytables/meta.yaml b/conda/pytables/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b3b2cfa895cf83b45034efdb1e6d884ff76b6209 --- /dev/null +++ b/conda/pytables/meta.yaml @@ -0,0 +1,81 @@ +{% set version = "3.6.1" %} + +package: + name: pytables + version: {{ version }} + +source: + url: https://pypi.io/packages/source/t/tables/tables-{{ version }}.tar.gz + sha256: 49a972b8a7c27a8a173aeb05f67acb45fe608b64cd8e9fa667c0962a60b71b49 + patches: + - do_not_copy_dlls_into_package.patch + - remove_dll_check.patch + +build: + number: 0 + entry_points: + - pt2to3 = tables.scripts.pt2to3:main + - ptdump = tables.scripts.ptdump:main + - ptrepack = tables.scripts.ptrepack:main + - pttree = tables.scripts.pttree:main + skip: true # [py<35] + ignore_run_exports: + - zlib + - lzo # [win] + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: + - python {{ python }} + - pip {{ pip }} + - cython {{ cython }} + - numpy-devel {{ numpy }} + - zlib {{ zlib }} + - lzo {{ lzo }} + - bzip2 {{ bzip2 }} + - hdf5 {{ hdf5 }} + - numexpr {{ numexpr }} + - blosc {{ blosc }} + run: + - {{ pin_compatible('python') }} + - {{ pin_compatible('six') }} + - {{ pin_compatible('numexpr') }} + - {{ pin_compatible('hdf5') }} + - {{ pin_compatible('zlib') }} + - {{ pin_compatible('lzo') }} + - {{ pin_compatible('bzip2') }} + - {{ pin_compatible('blosc') }} + - {{ pin_compatible('mock') }} + +test: + requires: + - setuptools + - mock + commands: + - pt2to3 -h + - ptdump -h + - ptrepack -h + - pttree -h + + +about: + home: http://www.pytables.org + license: BSD 3-Clause + license_file: LICENSE.txt + summary: 'Brings together Python, HDF5 and NumPy to easily handle large amounts of data.' + description: | + PyTables is a package for managing hierarchical datasets and designed to + efficiently and easily cope with extremely large amounts of data. PyTables + is built on top of the HDF5 library, using the Python language and the + NumPy package. + doc_url: http://www.pytables.org/ + dev_url: https://github.com/PyTables + +extra: + recipe-maintainers: + - msarahan + - ocefpaf + - tomkooij + - scopatz diff --git a/conda/pytables/remove_dll_check.patch b/conda/pytables/remove_dll_check.patch new file mode 100644 index 0000000000000000000000000000000000000000..e1048323a84eeee2181502a759e54b3628c87ea2 --- /dev/null +++ b/conda/pytables/remove_dll_check.patch @@ -0,0 +1,86 @@ +diff --git a/tables/__init__.py b/tables/__init__.py +index 5c2430a..782e085 100644 +--- a/tables/__init__.py ++++ b/tables/__init__.py +@@ -20,81 +20,6 @@ to efficiently cope with extremely large amounts of data. + """ + + +-import os +-import sys +- +- +-# On Windows, pre-load the HDF5 DLLs into the process via Ctypes +-# to improve diagnostics and avoid issues when loading DLLs during runtime. +-# However, if running from a frozen app (via PyInstaller), skip the check. +-if os.name == 'nt' and not getattr(sys, 'frozen', False): +- import ctypes +- +- def _load_library(dllname, loadfunction, dllpaths=('', )): +- """Load a DLL via ctypes load function. Return None on failure. +- +- By default, try to load the DLL from the current package +- directory first, then from the Windows DLL search path. +- +- Python >= 3.8 no longer searches PATH for DLLs. Skip PATH modification +- on Python >= 3.8. +- +- """ +- try: +- dllpaths = (os.path.abspath( +- os.path.dirname(__file__)), ) + dllpaths +- except NameError: +- pass # PyPy and frozen distributions have no __file__ attribute +- oldenv = None +- for path in dllpaths: +- if path and sys.version_info < (3, 8): +- # Temporarily add the path to the PATH environment variable +- # so Windows can find additional DLL dependencies. +- try: +- oldenv = os.environ['PATH'] +- os.environ['PATH'] = path + ';' + oldenv +- except KeyError: +- oldenv = None +- try: +- return loadfunction(os.path.join(path, dllname)) +- except WindowsError: +- pass +- finally: +- if path and oldenv is not None: +- os.environ['PATH'] = oldenv +- return None +- +- # In order to improve diagnosis of a common Windows dependency +- # issue, we explicitly test that we can load the HDF5 dll before +- # loading tables.utilsextensions. +- import sys +- hdf5_dlls = ['hdf5.dll', 'hdf5dll.dll', 'pytables_hdf5.dll'] +- if hasattr(sys, 'gettotalrefcount'): # running with debug interpreter +- hdf5_dlls = ['hdf5_D.dll', 'hdf5ddll.dll'] +- for dll in hdf5_dlls: +- if _load_library(dll, ctypes.cdll.LoadLibrary): +- break +- else: +- if sys.version_info < (3, 8): +- dll_loc = 'can be found in the system path' +- else: +- dll_loc = 'is installed in the package folder' +- raise ImportError( +- 'Could not load any of %s, please ensure that it %s.' % (hdf5_dlls, dll_loc)) +- +- # Some PyTables binary distributions place the dependency DLLs in the +- # tables package directory. +- # The lzo2 and libbz2 DLLs are loaded dynamically at runtime but can't be +- # found because the package directory is not in the Windows DLL search +- # path. +- # This pre-loads lzo2 and libbz2 DLLs from the tables package directory. +- if not _load_library('lzo2.dll', ctypes.cdll.LoadLibrary): +- pass +- +- if not _load_library('libbz2.dll', ctypes.cdll.LoadLibrary): +- pass +- +- + # Necessary imports to get versions stored on the cython extension + from .utilsextension import ( + get_pytables_version, get_hdf5_version, blosc_compressor_list, diff --git a/conda/pytables/run_test.py b/conda/pytables/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..df53601266c4663d2ed6ed17e00d8f161c8a8598 --- /dev/null +++ b/conda/pytables/run_test.py @@ -0,0 +1,19 @@ +import sys +import os +import tables +import tables._comp_bzip2 +# We don't build this one on Windows. +if not sys.platform == "win32": + import tables._comp_lzo +import tables.hdf5extension +import tables.indexesextension +import tables.linkextension +import tables.lrucacheextension +import tables.tableextension +import tables.utilsextension + + +if __name__ == "__main__": + from multiprocessing import freeze_support + freeze_support() + tables.test() diff --git a/conda_build_config.yaml b/conda_build_config.yaml index 0f44a4cc5070c6e5b917c38b1504fe0d6fcecb03..fccb24dc3f327a0e624a313fbb5b92d06fdf3458 100644 --- a/conda_build_config.yaml +++ b/conda_build_config.yaml @@ -69,6 +69,12 @@ zip_keys: # The dependencies that we link against (host requirements). +blosc: + - 1.20.1 +bzip2: + - 1.0.8 +cython: + - 0.29.21 ffmpeg: - 4.2.2 freetype: @@ -87,10 +93,18 @@ libpng: - 1.6.37 libtiff: - 4.1.0 +lzo: + - 2.10 mkl: - 2019.4 +mock: + - 4.0.3 +numexpr: + - 2.7.2 numpy: - 1.16 +pip: + - 20.3.3 xz: - 5.2.5 zlib: diff --git a/python.txt b/python.txt index 45b2413b62c05e9017ae51cf33f58af389b71f66..cea9551083bda9412c831d2815d2af75b878da14 100644 --- a/python.txt +++ b/python.txt @@ -1,4 +1,5 @@ conda/opencv +conda/pytables conda/zc.buildout conda/zc.recipe.egg conda/schema