Skip to content

Commit b8292a1

Browse files
MAINT: __package__ → __spec__.parent
Remove deprecated __package__, scheduled for removal in Python 3.15: https://docs.python.org/3.15/reference/datamodel.html#module.__package__
1 parent 75ee8bc commit b8292a1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

array_api_compat/cupy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from ._info import __array_namespace_info__ # noqa: F401
1010

1111
# See the comment in the numpy __init__.py
12-
__import__(__package__ + '.linalg')
13-
__import__(__package__ + '.fft')
12+
__import__(__spec__.parent + '.linalg')
13+
__import__(__spec__.parent + '.fft')
1414

1515
__array_api_version__: Final = '2025.12'
1616

array_api_compat/dask/array/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
del Final
1414

1515
# See the comment in the numpy __init__.py
16-
__import__(__package__ + '.linalg')
17-
__import__(__package__ + '.fft')
16+
__import__(__spec__.parent + '.linalg')
17+
__import__(__spec__.parent + '.fft')
1818

1919
__all__ = sorted(
2020
set(__all__)

array_api_compat/numpy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#
2121
# It doesn't overwrite np.linalg from above. The import is generated
2222
# dynamically so that the library can be vendored.
23-
__import__(__package__ + ".linalg")
23+
__import__(__spec__.parent + ".linalg")
2424

25-
__import__(__package__ + ".fft")
25+
__import__(__spec__.parent + ".fft")
2626

2727
from .linalg import matrix_transpose, vecdot # type: ignore[no-redef] # noqa: F401
2828

array_api_compat/torch/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from ._info import __array_namespace_info__ # noqa: F401
1111

1212
# See the comment in the numpy __init__.py
13-
__import__(__package__ + '.linalg')
14-
__import__(__package__ + '.fft')
13+
__import__(__spec__.parent + '.linalg')
14+
__import__(__spec__.parent + '.fft')
1515

1616
__array_api_version__: Final = '2025.12'
1717

0 commit comments

Comments
 (0)