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

refactor: Replace bootstrap script with explicit Cython declarations #669

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
282 changes: 0 additions & 282 deletions python/bootstrap.py

This file was deleted.

10 changes: 0 additions & 10 deletions python/generate_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ def main():
target_src_dir = subproj_dir / "src"
shutil.copytree(src_dir / "src", target_src_dir)

# CMake isn't actually required for building, but the bundle.py script reads from
# its configuration
shutil.copy(src_dir / "CMakeLists.txt", subproj_dir / "CMakeLists.txt")

subproj_ci_scripts_dir = subproj_dir / "ci" / "scripts"
subproj_ci_scripts_dir.mkdir(parents=True)
shutil.copy(
src_dir / "ci" / "scripts" / "bundle.py", subproj_ci_scripts_dir / "bundle.py"
)


if __name__ == "__main__":
main()
4 changes: 3 additions & 1 deletion python/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ project(
# due to https://github.com/mesonbuild/meson/issues/6728
'arrow-nanoarrow:ipc=true',
'arrow-nanoarrow:device=true',
'arrow-nanoarrow:namespace=PythonPkg',
# Adding this namespace doesn't work with the autopxd generation
# is that a problem?
#'arrow-nanoarrow:namespace=PythonPkg',
],
)

Expand Down
1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Changelog = "https://github.com/apache/arrow-nanoarrow/blob/main/CHANGELOG.md"

[build-system]
requires = [
"autopxd2",
"meson>=1.3.0",
"meson-python",
"Cython"
Expand Down
5 changes: 4 additions & 1 deletion python/src/nanoarrow/_array.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ from nanoarrow_c cimport (
NANOARROW_VALIDATION_LEVEL_FULL,
NANOARROW_VALIDATION_LEVEL_MINIMAL,
NANOARROW_VALIDATION_LEVEL_NONE,
)

from nanoarrow_macros cimport (
NANOARROW_OK,
ARROW_DEVICE_CPU,
)

from nanoarrow_device_c cimport (
ARROW_DEVICE_CPU,
ArrowDeviceType,
ArrowDeviceArray,
ArrowDeviceArrayInit,
Expand Down
7 changes: 4 additions & 3 deletions python/src/nanoarrow/_buffer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ from cpython cimport (
from cpython.ref cimport Py_INCREF, Py_DECREF

from nanoarrow_c cimport (
NANOARROW_OK,
ArrowMalloc,
ArrowFree,
ArrowType,
Expand All @@ -55,12 +54,14 @@ from nanoarrow_c cimport (
ArrowBufferMove,
)

from nanoarrow_device_c cimport (
from nanoarrow_macros cimport (
NANOARROW_OK,
ARROW_DEVICE_CPU,
ARROW_DEVICE_CUDA,
ArrowDevice,
)

from nanoarrow_device_c cimport ArrowDevice

from nanoarrow_dlpack cimport (
DLDataType,
DLDevice,
Expand Down
10 changes: 7 additions & 3 deletions python/src/nanoarrow/_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
from libc.stdint cimport uintptr_t, int64_t

from nanoarrow_device_c cimport (
ArrowDevice,
ArrowDeviceCpu,
ArrowDeviceResolve
)

from nanoarrow_macros cimport (
NANOARROW_OK,
ARROW_DEVICE_CPU,
ARROW_DEVICE_CUDA,
ARROW_DEVICE_CUDA_HOST,
Expand All @@ -34,9 +41,6 @@ from nanoarrow_device_c cimport (
ARROW_DEVICE_ONEAPI,
ARROW_DEVICE_WEBGPU,
ARROW_DEVICE_HEXAGON,
ArrowDevice,
ArrowDeviceCpu,
ArrowDeviceResolve
)

from nanoarrow._utils cimport Error
Expand Down
3 changes: 2 additions & 1 deletion python/src/nanoarrow/_ipc_lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ from nanoarrow_c cimport (
ArrowSchema,
ArrowErrorCode,
ArrowError,
NANOARROW_OK,
)

from nanoarrow_macros cimport NANOARROW_OK

from nanoarrow._schema cimport CSchema
from nanoarrow._array cimport CArrayView
from nanoarrow._utils cimport Error
Expand Down
Loading
Loading