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

Release 2.2.8 #135

Merged
merged 15 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests

on: [push, pull_request]
on: [push]

jobs:
build_wheels:
Expand All @@ -16,11 +16,6 @@ jobs:
with:
submodules: 'recursive'

# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: ${{ matrix.python-version }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -29,21 +24,14 @@ jobs:
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Install dependencies
- name: Build
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-tests.txt
# For some reason, the created ndindex wheel issues the next error on Win:
# ImportError: DLL load failed while importing ndindex: %1 is not a valid Win32 application.
# As a workaround, we install ndindex from conda-forge, but this should be fixed somehow
# This has been fixed; see https://github.com/Quansight-Labs/ndindex/issues/156
# conda install -c conda-forge ndindex
python -m pip install -r requirements-runtime.txt

- name: Build
run: |
python setup.py build_ext --inplace

- name: Test
run: |
python -m pip install -r requirements-runtime.txt
python -m pip install -r requirements-tests.txt
python -m pytest
76 changes: 27 additions & 49 deletions .github/workflows/cibuildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,38 @@ on:
branches:
- main

env:
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest psutil
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_TEST_SKIP: "*macosx*arm64*"
# Building for musllinux and aarch64 takes way too much time.
# NumPy is adding musllinux for just x86_64 too, so this is not too bad.
CIBW_SKIP: "*musllinux*aarch64*"

jobs:

build_wheels:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
# Only build wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: "x86_64 arm64"
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x86_64, aarch64]
cibw_build: ["cp3{9,10,11,12}-*"]
p_ver: ["3.9-3.12"]
exclude:
- os: windows-latest
arch: aarch64
# cibuild is already in charge to build aarch64 (see CIBW_ARCHS_MACOS)
- os: macos-latest
arch: aarch64

Expand All @@ -35,61 +52,22 @@ jobs:
with:
submodules: 'recursive'

# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: ${{ matrix.python-version }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel

- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Install MSVC amd64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: Install dependencies
- name: Build wheels
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-test-wheels.txt
python -m pip install -r requirements-runtime.txt

- name: Build wheels (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64'
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_BUILD_VERBOSITY: 1

- name: Build wheels (Linux / Mac OSX)
if: runner.os != 'Windows'
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*'
CIBW_SKIP: '*-manylinux*_i686 *-musllinux_* ${{ env.CIBW_SKIP}}'
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: "x86_64 arm64"

- name: Upload wheels
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -123,8 +101,6 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
python -m pip install -r requirements-tests.txt
python -m pip install -r requirements-runtime.txt

- name: Build sdist
run: |
Expand All @@ -145,6 +121,8 @@ jobs:
- name: Test sdist package with pytest
run: |
cd ./dist/blosc2-*/
python -m pip install -r requirements-tests.txt
python -m pip install -r requirements-runtime.txt
python -m pytest -m "not heavy"

upload_pypi:
Expand Down
7 changes: 3 additions & 4 deletions ANNOUNCE.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Announcing Python-Blosc2 2.2.7
Announcing Python-Blosc2 2.2.8
==============================

This is a maintenance release, where we have upgraded to latest C-Blosc2 2.10.3.
This provides the ability to use the blosc2_openhtj2k dynamic plugin
(see https://github.com/Blosc/blosc2_openhtj2k for more info on this).
This is a maintenance release, where we are providing binary wheels
for Python 3.12 (yay!). We have also upgraded to latest C-Blosc2 2.10.4.

For more info, you can have a look at the release notes in:

Expand Down
6 changes: 5 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

## Changes from 2.2.7 to 2.2.8

* XXX version-specific blurb XXX
* Binary wheels for forthcoming Python 3.12 are available!

* Different improvements suggested by refurb and pyupgrade.
Thanks to Dimitri Papadopoulos.

* Updated to latest C-Blosc2 2.10.4.

## Changes from 2.2.6 to 2.2.7

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.8.dev0
2.2.8
22 changes: 17 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[build-system]
requires = ["setuptools", "scikit-build", "cython<3", "cmake", "ninja", "oldest-supported-numpy"]
requires = [
"setuptools",
"scikit-build",
"cython",
"cmake",
"ninja",
"oldest-supported-numpy"]

[project]
name = "blosc2"
Expand All @@ -19,20 +25,26 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.8, <4"
dynamic = ["version", "dependencies"]
requires-python = ">=3.9, <4"
dependencies = [
"numpy>=1.20.3",
"ndindex>=1.4",
"msgpack",
"py-cpuinfo",
]
dynamic = ["version"]

[project.urls]
homepage = "https://github.com/Blosc/python-blosc2"
documentation = "https://www.blosc.org/python-blosc2/python-blosc2.html"

[tool.cibuildwheel]
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
skip = "cp36-* cp37-* pp37-* cp38-* pp38-* *-manylinux_i686 *_ppc64le *_s390x"

[tool.black]
line-length = 109
Expand Down
6 changes: 4 additions & 2 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
setuptools
scikit-build
cython<3
cython
cmake
numpy<2
oldest-supported-numpy
ninja
build
1 change: 0 additions & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pip
numpy<2
pytest
psutil
Expand Down
11 changes: 4 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@

from skbuild import setup


def cmake_bool(cond):
return "ON" if cond else "OFF"


# Blosc version
VERSION = open("VERSION").read().strip()
# Create the version.py file
open("blosc2/version.py", "w").write(f'__version__ = "{VERSION}"\n')


def exclude_pkgconfig(cmake_manifest):
"""remove pkgconfig file from installation: gh-110."""
return list(filter(lambda name: not (name.endswith('.pc')), cmake_manifest))
return list(filter(lambda name: not (name.endswith(".pc")), cmake_manifest))


# These keywords need to be in setup()
# https://scikit-build.readthedocs.io/en/latest/usage.html#setuptools-options
Expand All @@ -30,5 +27,5 @@ def exclude_pkgconfig(cmake_manifest):
package_dir={"blosc2": "blosc2"},
include_package_data=True,
cmake_process_manifest_hook=exclude_pkgconfig,
install_requires=open("requirements-runtime.txt").read().split(),
# install_requires=open("requirements-runtime.txt").read().split(),
)
2 changes: 1 addition & 1 deletion tests/ndarray/test_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
def test_mode(shape, fill_value, cparams, dparams, dtype, urlpath, contiguous, mode):
blosc2.remove_urlpath(urlpath)
if mode == "r":
with pytest.raises(RuntimeError):
with pytest.raises(ValueError):
blosc2.full(
shape,
fill_value,
Expand Down
8 changes: 5 additions & 3 deletions tests/ndarray/test_zeros.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# LICENSE file in the root directory of this source tree)
#######################################################################

import math

import numpy as np
import pytest

Expand Down Expand Up @@ -46,8 +48,8 @@
{"abc": 123, "2": [0, 1, 24]},
),
(
(2**32,),
(2**31,),
(2**31 - 1,),
(2**30,),
None,
np.float32,
{"codec": blosc2.Codec.LZ4, "clevel": 5, "nthreads": 2},
Expand All @@ -61,7 +63,7 @@ def test_zeros(shape, chunks, blocks, dtype, cparams, urlpath, contiguous, meta)
blosc2.remove_urlpath(urlpath)

dtype = np.dtype(dtype)
if np.prod(chunks) * dtype.itemsize > blosc2.MAX_BUFFERSIZE:
if math.prod(chunks) * dtype.itemsize > blosc2.MAX_BUFFERSIZE:
with pytest.raises(RuntimeError):
_ = blosc2.zeros(
shape,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def test_pack_array2_struct(size, dtype):
assert np.array_equal(nparray, a2)


@pytest.mark.skipif(os.name == "nt", reason="Torch has issues with oldest-supported-numpy on Windows")
@pytest.mark.parametrize(
"size, dtype",
[
Expand Down Expand Up @@ -187,6 +188,7 @@ def test_save_tensor_tensorflow(size, dtype, urlpath):
assert np.array_equal(nparray, np.asarray(tensor2))


@pytest.mark.skipif(os.name == "nt", reason="Torch has issues with oldest-supported-numpy on Windows")
@pytest.mark.parametrize(
"size, dtype, urlpath",
[
Expand Down
Loading