Skip to content

Commit

Permalink
[python] Work around pyarrow>=13 issue on MacOS, 1.10 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Jun 14, 2024
1 parent babb931 commit 2fdac1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
8 changes: 1 addition & 7 deletions apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,7 @@ def run(self):
"attrs>=22.2",
"numba>=0.58.0",
"pandas",
# TODO: once we no longer support Python 3.7, remove this and pin to pyarrow >= 14.0.1
# https://github.com/single-cell-data/TileDB-SOMA/issues/1926
"pyarrow_hotfix",
# MacOS issue with import pyarrow before import tiledb at >= 13.0:
# https://github.com/single-cell-data/TileDB-SOMA/issues/1926#issuecomment-1834695149
"pyarrow>=9.0.0,<13.0.0; platform_system=='Darwin'",
"pyarrow>=9.0.0; platform_system!='Darwin'",
"pyarrow>=14.0.0",
"scanpy>=1.9.2",
"scipy",
# Note: the somacore version is in .pre-commit-config.yaml too
Expand Down
12 changes: 7 additions & 5 deletions apis/python/src/tiledbsoma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@
:class:`ValueError`.
"""

# This ABSOLUTELY MUST be imported before pyarrow to avoid abort-traps on MacOS
# with any pyarrow >= 13. And the pre-commit hook, isort, et al. MUST NOT be
# allowed to reorder this. See also
# https://github.com/single-cell-data/TileDB-SOMA/issues/1926
# https://github.com/single-cell-data/TileDB-SOMA/issues/1849
import tiledb # noqa E402

# ^^ the rest is autogen whether viewed from Python on-line help, Sphinx/readthedocs, etc. It's
# crucial that we include a separator (e.g. "Classes and functions") to make an entry in the
# readthedocs table of contents.
Expand Down Expand Up @@ -138,11 +145,6 @@
from somacore import AxisColumnNames, AxisQuery, ExperimentAxisQuery
from somacore.options import ResultOrder

# TODO: once we no longer support Python 3.7, remove this and pin to pyarrow >= 14.0.1
# https://github.com/single-cell-data/TileDB-SOMA/issues/1926
# ruff: noqa
import pyarrow_hotfix

from ._collection import Collection
from ._constants import SOMA_JOINID
from ._dataframe import DataFrame
Expand Down
7 changes: 7 additions & 0 deletions apis/python/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# This ABSOLUTELY MUST be imported before pyarrow to avoid abort-traps on MacOS
# with any pyarrow >= 13. And the pre-commit hook, isort, et al. MUST NOT be
# allowed to reorder this. See also
# https://github.com/single-cell-data/TileDB-SOMA/issues/1926
# https://github.com/single-cell-data/TileDB-SOMA/issues/1849
import tiledb # noqa E402

import pyarrow as pa
from typeguard import install_import_hook

Expand Down

0 comments on commit 2fdac1d

Please sign in to comment.