Skip to content

Commit ab8dcdf

Browse files
build: update for py312
1 parent 6c3a701 commit ab8dcdf

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.github/workflows/build_wheel.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ on:
55
tags:
66
- '*'
77
env:
8-
CIBW_SKIP: cp27-* cp33-* cp34-* cp35-* pp27* pp36* pp37* pp38* pp39* pp310* *-musllinux_aarch64
8+
CIBW_SKIP: cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* pp* *-musllinux_aarch64
99

1010
jobs:
1111
build_wheels:
1212
name: Build wheels on ${{matrix.arch}} for ${{ matrix.os }}
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-20.04, windows-2019, macos-latest]
16+
os: [ubuntu-latest, windows-2019, macos-latest]
1717
arch: [auto]
1818
include:
19-
- os: ubuntu-20.04
19+
- os: ubuntu-latest
2020
arch: aarch64
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424

2525
- name: Set up QEMU
2626
if: ${{ matrix.arch == 'aarch64' }}
@@ -31,8 +31,8 @@ jobs:
3131
# to supply options, put them in 'env', like:
3232
env:
3333
CIBW_ARCHS_LINUX: ${{matrix.arch}}
34-
CIBW_BEFORE_BUILD: pip install oldest-supported-numpy
34+
CIBW_BEFORE_BUILD: pip install oldest-supported-numpy setuptools wheel cython
3535

36-
- uses: actions/upload-artifact@v2
36+
- uses: actions/upload-artifact@v4
3737
with:
3838
path: ./wheelhouse/*.whl

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGES
22
=======
33

4+
2.2.1
5+
-----
6+
7+
* config: update formatting of setup.cfg
48
* build: update build to use pyx and easier numpy install
59
* test: py38, 39, 310, 311
610
* build: update build for py311

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __repr__(self):
3636
'compressed_segmentation.pyx'
3737
)],
3838
language='c++',
39-
include_dirs=[ 'include', NumpyImport() ],
39+
include_dirs=[ 'include', str(NumpyImport()) ],
4040
extra_compile_args=extra_compile_args,
4141
),
4242
],

src/compressed_segmentation.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ from functools import reduce
2626

2727
from libcpp.vector cimport vector
2828

29+
import cython
2930
cimport numpy as np
3031
import numpy as np
3132

@@ -56,6 +57,7 @@ DEFAULT_BLOCK_SIZE = (8,8,8)
5657
class DecodeError(Exception):
5758
pass
5859

60+
@cython.binding(True)
5961
def compress(data, block_size=DEFAULT_BLOCK_SIZE, order='C'):
6062
"""
6163
compress(data, block_size=DEFAULT_BLOCK_SIZE, order='C')
@@ -194,6 +196,7 @@ cdef decompress_helper(
194196
del output
195197
return np.frombuffer(buf, dtype=dtype).reshape( volume_size, order=order )
196198

199+
@cython.binding(True)
197200
def decompress(
198201
bytes encoded, volume_size, dtype,
199202
block_size=DEFAULT_BLOCK_SIZE, order='C'
@@ -222,6 +225,7 @@ def decompress(
222225
else:
223226
raise TypeError("dtype ({}) must be one of uint32 or uint64.".format(dtype))
224227

228+
@cython.binding(True)
225229
def labels(
226230
bytes encoded, shape, dtype,
227231
block_size=DEFAULT_BLOCK_SIZE
@@ -252,6 +256,7 @@ def labels(
252256

253257
return np.unique(labels)
254258

259+
@cython.binding(True)
255260
def remap(
256261
bytes encoded, shape, dtype,
257262
mapping, preserve_missing_labels=False,

0 commit comments

Comments
 (0)