Skip to content

Commit 4b2ac54

Browse files
authored
Fix serialization test and add command line option (#2052)
1 parent e717557 commit 4b2ac54

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ TILEDB_PATH = {env="TILEDB_PATH"}
8383
TILEDB_VERSION = {env="TILEDB_VERSION"}
8484
TILEDB_HASH = {env="TILEDB_HASH"}
8585
TILEDB_REMOVE_DEPRECATIONS = "ON"
86+
TILEDB_SERIALIZATION = "OFF"
8687

8788
[tool.pytest.ini_options]
8889
python_classes = "*Test*"

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def main():
99
parser.add_argument("--tiledb", type=str, required=False)
1010
parser.add_argument("--debug", action="store_true")
1111
parser.add_argument("--enable-deprecations", action="store_true", required=False)
12+
parser.add_argument("--enable-serialization", action="store_true", required=False)
1213
parser.add_argument("-v", action="store_true")
1314
args = parser.parse_args()
1415

@@ -33,6 +34,9 @@ def main():
3334
if args.enable_deprecations:
3435
cmd.append(f"-Cskbuild.cmake.define.TILEDB_REMOVE_DEPRECATIONS=OFF")
3536

37+
if args.enable_serialization:
38+
cmd.append(f"-Cskbuild.cmake.define.TILEDB_SERIALIZATION=ON")
39+
3640
if args.v:
3741
cmd.append("-v")
3842

tiledb/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ target_compile_features(
5656
cxx_std_20
5757
)
5858

59+
if (TILEDB_SERIALIZATION)
60+
target_compile_definitions(
61+
main
62+
PRIVATE
63+
TILEDB_SERIALIZATION
64+
)
65+
endif()
66+
5967
install(TARGETS main libtiledb DESTINATION tiledb)
6068

6169
if(TILEDB_DOWNLOADED)

tiledb/cc/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ if (TILEDB_REMOVE_DEPRECATIONS)
4242
)
4343
endif()
4444

45+
if (TILEDB_SERIALIZATION)
46+
target_compile_definitions(
47+
cc
48+
PRIVATE
49+
TILEDB_SERIALIZATION
50+
)
51+
endif()
52+
4553
install(TARGETS cc DESTINATION tiledb)
4654

4755
if(TILEDB_DOWNLOADED)

tiledb/tests/test_serialization.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
from .common import DiskTestCase
77

8-
ser_test = pytest.importorskip(
9-
"tiledb.main.test_serialization", reason="Serialization not enabled."
10-
)
8+
try:
9+
from tiledb.main import test_serialization as ser_test
10+
except ImportError:
11+
pytest.skip("Serialization not enabled.", allow_module_level=True)
1112

1213

1314
class SerializationTest(DiskTestCase):

0 commit comments

Comments
 (0)