Skip to content

Commit 6b4d914

Browse files
committed
Use typing_extensions for deprecations
1 parent 150a83e commit 6b4d914

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

numcodecs/blosc.pyx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import threading
77
import multiprocessing
88
import os
9-
from deprecated import deprecated
9+
from typing_extensions import deprecated
1010

1111

1212
from cpython.buffer cimport PyBUF_ANY_CONTIGUOUS, PyBUF_WRITEABLE
@@ -100,15 +100,15 @@ def _init():
100100
"""Initialize the Blosc library environment."""
101101
blosc_init()
102102

103-
init = deprecated(_init)
103+
init = deprecated("init is deprecated, with no replacement")(_init)
104104

105105

106106
def _destroy():
107107
"""Destroy the Blosc library environment."""
108108
blosc_destroy()
109109

110110

111-
destroy = deprecated(_destroy)
111+
destroy = deprecated("destroy is deprecated, with no replacement")(_destroy)
112112

113113

114114
def _compname_to_compcode(cname):
@@ -119,7 +119,7 @@ def _compname_to_compcode(cname):
119119
cname = cname.encode('ascii')
120120
return blosc_compname_to_compcode(cname)
121121

122-
compname_to_compcode = deprecated(_compname_to_compcode)
122+
compname_to_compcode = deprecated("compname_to_compcode is deprecated, with no replacement")(_compname_to_compcode)
123123

124124

125125
def list_compressors():
@@ -226,13 +226,13 @@ def _cbuffer_metainfo(source):
226226

227227
return typesize, shuffle, memcpyed
228228

229-
cbuffer_metainfo = deprecated(_cbuffer_metainfo)
229+
cbuffer_metainfo = deprecated("cbuffer_metainfo is deprecated, with no replacement")(_cbuffer_metainfo)
230230

231231
def _err_bad_cname(cname):
232232
raise ValueError('bad compressor or compressor not supported: %r; expected one of '
233233
'%s' % (cname, list_compressors()))
234234

235-
err_bad_cname = deprecated(_err_bad_cname)
235+
err_bad_cname = deprecated("err_bad_cname is deprecated, with no replacement")(_err_bad_cname)
236236

237237
def compress(source, char* cname, int clevel, int shuffle=SHUFFLE,
238238
int blocksize=AUTOBLOCKS):
@@ -489,7 +489,7 @@ def _decompress_partial(source, start, nitems, dest=None):
489489

490490
return dest
491491

492-
decompress_partial = deprecated(_decompress_partial)
492+
decompress_partial = deprecated("decompress_partial is deprecated, with no replacement")(_decompress_partial)
493493

494494
# set the value of this variable to True or False to override the
495495
# default adaptive behaviour

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ for use in data storage and communication applications."""
1616
readme = "README.rst"
1717
dependencies = [
1818
"numpy>=1.24",
19+
"typing_extensions>=4.5.0"
1920
]
2021
requires-python = ">=3.11"
2122
dynamic = [

0 commit comments

Comments
 (0)