forked from pool/python-blosc
Accepting request 872001 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/872001 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-blosc?expand=0&rev=19
This commit is contained in:
commit
e768c78e14
3
blosc-1.10.2.tar.gz
Normal file
3
blosc-1.10.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eeba922f52becd697dc5cfcee8d01a03ba9597a54ce91fdacd9998492acbed9b
|
||||
size 858096
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:89196a2112035836f027a29835ee247b0c7a45cece4cd9e4b740a1428aa174bf
|
||||
size 816897
|
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Feb 13 13:40:00 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Update to version 1.10.2
|
||||
* (Upstream bumped the version to release their wheels)
|
||||
* Officially drop support for Python < 3.7. Although we did not
|
||||
any explicit action that is incompatible with older Python
|
||||
versions, we only provide wheels for Python >= 3.7 (til 3.9).
|
||||
- Skip python36 build on TW, because upstream dropped support and
|
||||
numpy follows NEP 29
|
||||
- Use the system provided Blosc library
|
||||
* use-system-blosc.patch gh#Blosc/python-blosc#244
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Dec 20 18:35:01 UTC 2020 - andy great <andythe_great@pm.me>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-blosc
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -18,28 +18,31 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define skip_python2 1
|
||||
# Upstream dropped official support for Python < 3.7 and python36-numpy is being phased out of TW
|
||||
%define skip_python36 1
|
||||
Name: python-blosc
|
||||
Version: 1.9.2
|
||||
Version: 1.10.2
|
||||
Release: 0
|
||||
Summary: Blosc data compressor for Python
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/Blosc/python-blosc
|
||||
Source: https://files.pythonhosted.org/packages/source/b/blosc/blosc-%{version}.tar.gz
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module scikit-build}
|
||||
# PATCH-FEATURE-UPSTREAM use-system-blosc.patch -- gh#Blosc/python-blosc#244
|
||||
Patch0: https://github.com/Blosc/python-blosc/pull/244.patch#/use-system-blosc.patch
|
||||
BuildRequires: %{python_module devel >= 3.7}
|
||||
BuildRequires: %{python_module scikit-build >= 0.11.1}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: blosc-devel >= 1.9.0
|
||||
BuildRequires: c++_compiler
|
||||
BuildRequires: cmake
|
||||
BuildRequires: cmake >= 3.14.0
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: ninja
|
||||
BuildRequires: python-rpm-macros
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module numpy >= 1.16}
|
||||
BuildRequires: %{python_module psutil}
|
||||
# /SECTION
|
||||
Requires: blosc-devel
|
||||
Recommends: python-numpy
|
||||
%python_subpackages
|
||||
|
||||
@ -48,31 +51,26 @@ Blosc is a high performance compressor optimized for binary data in
|
||||
Python.
|
||||
|
||||
%prep
|
||||
%setup -q -n blosc-%{version}
|
||||
%autosetup -p1 -n blosc-%{version}
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
export BLOSC_DIR=%{_prefix}
|
||||
export DISABLE_BLOSC_AVX2=1
|
||||
%python_exec setup.py build_clib
|
||||
%python_exec setup.py build_ext --inplace
|
||||
export USE_SYSTEM_BLOSC=1
|
||||
%python_build
|
||||
|
||||
%install
|
||||
export BLOSC_DIR=%{_prefix}
|
||||
# This is being installed in purelib instead of platlib
|
||||
# See: https://github.com/Blosc/python-blosc/issues/222
|
||||
%python_exec setup.py install -O1 --skip-build --force --root %{buildroot} --install-purelib=%{$python_sitearch}
|
||||
export USE_SYSTEM_BLOSC=1
|
||||
# gh#Blosc/python-blosc#222
|
||||
%python_expand %{$python_install} --install-purelib %{$python_sitearch}
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
%python_exec -m unittest discover -s blosc/ -v
|
||||
%pyunittest_arch discover -s blosc/ -v
|
||||
|
||||
%files %{python_files}
|
||||
%doc ANNOUNCE.rst README.rst RELEASE_NOTES.rst
|
||||
%license LICENSES/*.txt
|
||||
%{python_sitearch}/blosc-%{version}-py*.egg-info
|
||||
%{python_sitearch}/blosc-%{version}*-info
|
||||
%{python_sitearch}/blosc/
|
||||
|
||||
%changelog
|
||||
|
146
use-system-blosc.patch
Normal file
146
use-system-blosc.patch
Normal file
@ -0,0 +1,146 @@
|
||||
From ae63a9c222f95c898ca3fc0664254f655c5162eb Mon Sep 17 00:00:00 2001
|
||||
From: Ben Greiner <code@bnavigator.de>
|
||||
Date: Sat, 13 Feb 2021 18:58:31 +0100
|
||||
Subject: [PATCH] Reenable possibility to use an already installed C-Blosc
|
||||
library
|
||||
|
||||
---
|
||||
README.rst | 14 ++++++--------
|
||||
blosc/CMakeLists.txt | 33 +++++++++++++++++++--------------
|
||||
cmake/FindBlosc.cmake | 12 ++++++++++++
|
||||
setup.py | 23 +++++++++++++----------
|
||||
4 files changed, 50 insertions(+), 32 deletions(-)
|
||||
create mode 100644 cmake/FindBlosc.cmake
|
||||
|
||||
diff --git a/README.rst b/README.rst
|
||||
index 3329a21..c0385e1 100644
|
||||
--- a/README.rst
|
||||
+++ b/README.rst
|
||||
@@ -79,7 +79,7 @@ Installing via setuptools
|
||||
.. code-block:: console
|
||||
|
||||
$ python -m pip install -r requirements-dev.txt
|
||||
- $ python setup.py build_ext --inplace
|
||||
+ $ python setup.py build --inplace
|
||||
|
||||
Any codec can be enabled (`=1`) or disabled (`=0`) on this build-path with the appropriate
|
||||
OS environment variables `INCLUDE_LZ4`, `INCLUDE_SNAPPY`, `INCLUDE_ZLIB`, and
|
||||
@@ -115,17 +115,15 @@ Using an environment variable:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
- $ BLOSC_DIR=/usr/local (or "set BLOSC_DIR=\blosc" on Win)
|
||||
- $ export BLOSC_DIR (not needed on Win)
|
||||
- $ python setup.py build_clib
|
||||
- $ python setup.py build_ext --inplace
|
||||
+ $ export USE_SYSTEM_BLOSC=1 # or "set USE_SYSTEM_BLOSC=1" on Windows
|
||||
+ $ export Blosc_ROOT=/usr/local/customprefix # If you installed Blosc into a custom location
|
||||
+ $ python setup.py build --inplace
|
||||
|
||||
-Using a flag:
|
||||
+Using flags:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
- $ python setup.py build_clib
|
||||
- $ python setup.py build_ext --inplace --blosc=/usr/local
|
||||
+ $ python setup.py build --inplace -DUSE_SYSTEM_BLOSC:BOOL=YES -DBlosc_ROOT:PATH=/usr/local/customprefix
|
||||
|
||||
|
||||
Testing
|
||||
diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt
|
||||
index 7f06f28..f9a5214 100644
|
||||
--- a/blosc/CMakeLists.txt
|
||||
+++ b/blosc/CMakeLists.txt
|
||||
@@ -1,19 +1,24 @@
|
||||
-# Todo: c-blosc provides a CMake package configuration file that we can build
|
||||
-# against if blosc is available on the system, etc.
|
||||
-# find_package(blosc)
|
||||
-# if(NOT blosc_FOUND)
|
||||
-set(BUILD_STATIC ON CACHE BOOL "Build a static version of the blosc library.")
|
||||
-set(BUILD_SHARED ON CACHE BOOL "Build a shared library version of the blosc library.")
|
||||
-set(BUILD_TESTS OFF CACHE BOOL "Build test programs form the blosc compression library")
|
||||
-set(BUILD_BENCHMARKS OFF CACHE BOOL "Build benchmark programs form the blosc compression library")
|
||||
-set(BLOSC_IS_SUBPROJECT OFF CACHE BOOL "Blosc is subproject")
|
||||
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
-add_subdirectory(c-blosc)
|
||||
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/c-blosc/blosc")
|
||||
+add_library(blosc_extension MODULE blosc_extension.c)
|
||||
+
|
||||
+if(USE_SYSTEM_BLOSC)
|
||||
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
+ find_package(Blosc REQUIRED)
|
||||
+ target_include_directories(blosc_extension PRIVATE ${Blosc_INCLUDE_DIRS})
|
||||
+ target_link_libraries(blosc_extension ${Blosc_LIBRARIES})
|
||||
+else()
|
||||
+ set(BUILD_STATIC ON CACHE BOOL "Build a static version of the blosc library.")
|
||||
+ set(BUILD_SHARED ON CACHE BOOL "Build a shared library version of the blosc library.")
|
||||
+ set(BUILD_TESTS OFF CACHE BOOL "Build test programs form the blosc compression library")
|
||||
+ set(BUILD_BENCHMARKS OFF CACHE BOOL "Build benchmark programs form the blosc compression library")
|
||||
+ set(BLOSC_IS_SUBPROJECT OFF CACHE BOOL "Blosc is subproject")
|
||||
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
+ add_subdirectory(c-blosc)
|
||||
+ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/c-blosc/blosc")
|
||||
+ target_link_libraries(blosc_extension blosc_static)
|
||||
+endif()
|
||||
+
|
||||
|
||||
|
||||
-add_library(blosc_extension MODULE blosc_extension.c)
|
||||
-target_link_libraries(blosc_extension blosc_static)
|
||||
python_extension_module(blosc_extension)
|
||||
|
||||
add_custom_command(
|
||||
diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake
|
||||
new file mode 100644
|
||||
index 0000000..02a039f
|
||||
--- /dev/null
|
||||
+++ b/cmake/FindBlosc.cmake
|
||||
@@ -0,0 +1,12 @@
|
||||
+find_path(Blosc_INCLUDE_DIR blosc.h)
|
||||
+
|
||||
+find_library(Blosc_LIBRARY NAMES blosc)
|
||||
+
|
||||
+if (Blosc_INCLUDE_DIR AND Blosc_LIBRARY)
|
||||
+ set(Blosc_FOUND TRUE)
|
||||
+ set(Blosc_INCLUDE_DIRS ${Blosc_INCLUDE_DIR})
|
||||
+ set(Blosc_LIBRARIES ${Blosc_LIBRARY})
|
||||
+ message(STATUS "Found Blosc library: ${Blosc_LIBRARIES}")
|
||||
+else ()
|
||||
+ message(STATUS "No Blosc library found. Using internal sources.")
|
||||
+endif ()
|
||||
\ No newline at end of file
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 2fd6619..37b5827 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -85,16 +85,19 @@ def cmake_bool(cond):
|
||||
url = 'http://github.com/blosc/python-blosc',
|
||||
license = 'https://opensource.org/licenses/BSD-3-Clause',
|
||||
platforms = ['any'],
|
||||
- cmake_args = [
|
||||
- '-DBLOSC_DIR:PATH=%s' % os.environ.get('BLOSC_DIR', ''),
|
||||
- '-DDEACTIVATE_SSE2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_SSE2' in os.environ) or (cpu_info is None) or ('sse2' not in cpu_info['flags'])),
|
||||
- '-DDEACTIVATE_AVX2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_AVX2' in os.environ) or (cpu_info is None) or ('avx2' not in cpu_info['flags'])),
|
||||
- '-DDEACTIVATE_LZ4:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_LZ4', '1'))),
|
||||
- # Snappy is disabled by default
|
||||
- '-DDEACTIVATE_SNAPPY:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_SNAPPY', '0'))),
|
||||
- '-DDEACTIVATE_ZLIB:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_ZLIB', '1'))),
|
||||
- '-DDEACTIVATE_ZSTD:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_ZSTD', '1'))),
|
||||
- ],
|
||||
+ cmake_args = (
|
||||
+ ['-DUSE_SYSTEM_BLOSC:BOOL=ON'] if int(os.environ.get('USE_SYSTEM_BLOSC', '0'))
|
||||
+ else
|
||||
+ ['-DUSE_SYSTEM_BLOSC:BOOL=OFF',
|
||||
+ '-DDEACTIVATE_SSE2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_SSE2' in os.environ) or (cpu_info is None) or ('sse2' not in cpu_info['flags'])),
|
||||
+ '-DDEACTIVATE_AVX2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_AVX2' in os.environ) or (cpu_info is None) or ('avx2' not in cpu_info['flags'])),
|
||||
+ '-DDEACTIVATE_LZ4:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_LZ4', '1'))),
|
||||
+ # Snappy is disabled by default
|
||||
+ '-DDEACTIVATE_SNAPPY:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_SNAPPY', '0'))),
|
||||
+ '-DDEACTIVATE_ZLIB:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_ZLIB', '1'))),
|
||||
+ '-DDEACTIVATE_ZSTD:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_ZSTD', '1'))),
|
||||
+ ]
|
||||
+ ),
|
||||
setup_requires=['scikit-build'],
|
||||
tests_require=['numpy', 'psutil'],
|
||||
packages = ['blosc'],
|
Loading…
x
Reference in New Issue
Block a user