Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove modular building option #1938

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
# Use `setup.py [] --release-symbols` for a release build with symbols libtiledb
TILEDB_SYMBOLS_BUILD = False

# Use `setup.py [] --modular` for a modular build of libtiledb_py
# Each .pyx file will be built as a separate shared library for faster
# compilation. This is disabled by default to avoid distributing multiple
# shared libraries.
TILEDBPY_MODULAR = False

# Allow to override TILEDB_FORCE_ALL_DEPS with environment variable
TILEDB_FORCE_ALL_DEPS = "TILEDB_FORCE_ALL_DEPS" in os.environ
TILEDB_DISABLE_SERIALIZATION = "TILEDB_DISABLE_SERIALIZATION" in os.environ
Expand Down Expand Up @@ -435,7 +429,6 @@ def do_copy(src, dest):
ext_attr_update(
"cython_compile_time_env",
{
"TILEDBPY_MODULAR": TILEDBPY_MODULAR,
"LIBTILEDB_VERSION_MAJOR": major,
"LIBTILEDB_VERSION_MINOR": minor,
"LIBTILEDB_VERSION_PATCH": patch,
Expand Down Expand Up @@ -626,9 +619,6 @@ def install_requires():
if arg.find("--release-symbols") == 0:
TILEDB_SYMBOLS_BUILD = True
sys.argv.remove(arg)
if arg.find("--modular") == 0:
TILEDBPY_MODULAR = True
sys.argv.remove(arg)
TILEDBPY_WERROR = False
if arg.find("--werror") == 0:
TILEDBPY_WERROR = True
Expand Down Expand Up @@ -729,29 +719,7 @@ def install_requires():
),
]


if TILEDBPY_MODULAR:
for source in MODULAR_SOURCES:
module_name = os.path.splitext(os.path.split(source)[-1])[0]
if module_name + ".pxd" in MODULAR_HEADERS:
deps = module_name + ".pxd"
else:
deps = None
ext = Extension(
"tiledb.{}".format(module_name),
include_dirs=INC_DIRS,
define_macros=DEF_MACROS,
sources=[source],
depends=[deps] if deps else [],
library_dirs=LIB_DIRS,
libraries=LIBS,
extra_link_args=LFLAGS,
extra_compile_args=CXXFLAGS,
language="c++",
)
__extensions.append(ext)
else:
__extensions[0].depends += MODULAR_SOURCES
__extensions[0].depends += MODULAR_SOURCES

# Helper to set Extension attributes correctly based on python version
def ext_attr_update(attr, value):
Expand Down
4 changes: 0 additions & 4 deletions tiledb/indexing.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
IF TILEDBPY_MODULAR:
include "common.pxi"
from .libtiledb cimport *

from libc.stdio cimport printf

import weakref
Expand Down
5 changes: 0 additions & 5 deletions tiledb/libmetadata.pyx
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
IF TILEDBPY_MODULAR:
include "common.pxi"
from .libtiledb import *
from .libtiledb cimport *

import weakref
from collections.abc import MutableMapping

Expand Down
7 changes: 1 addition & 6 deletions tiledb/libtiledb.pxd
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from libc.stdint cimport uint32_t, uint64_t
from libc.stdio cimport FILE

IF TILEDBPY_MODULAR:
from .indexing cimport DomainIndexer

include "indexing.pxd"
include "common.pxi"

cdef extern from "Python.h":
Expand Down Expand Up @@ -1237,5 +1234,3 @@ cdef class ReadQuery(object):
cdef class Metadata(object):
cdef object array_ref

IF (not TILEDBPY_MODULAR):
include "indexing.pxd"
13 changes: 2 additions & 11 deletions tiledb/libtiledb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ from cpython.pycapsule cimport PyCapsule_GetPointer, PyCapsule_IsValid, PyCapsul
from cpython.version cimport PY_MAJOR_VERSION

include "common.pxi"
include "indexing.pyx"
include "libmetadata.pyx"
import io
import warnings
import collections.abc
Expand All @@ -27,17 +29,6 @@ from .vfs import VFS
# https://docs.scipy.org/doc/numpy/reference/c-api.array.html#c.import_array
np.import_array()


###############################################################################
# MODULAR IMPORTS #
###############################################################################

IF TILEDBPY_MODULAR:
from .indexing import DomainIndexer
ELSE:
include "indexing.pyx"
include "libmetadata.pyx"

###############################################################################
# Utility/setup #
###############################################################################
Expand Down
Loading