Skip to content

Commit

Permalink
refactor: Replace Python bootstrap script with explicit Cythond decla…
Browse files Browse the repository at this point in the history
…rtions
  • Loading branch information
WillAyd committed Oct 29, 2024
1 parent f8a6760 commit 287e062
Show file tree
Hide file tree
Showing 5 changed files with 389 additions and 321 deletions.
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()
30 changes: 1 addition & 29 deletions python/src/nanoarrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,6 @@ nanoarrow_device_dep = nanoarrow_proj.get_variable('nanoarrow_device_dep')

py = import('python').find_installation(pure: false)

vendored_files = custom_target(
'generate-pyx',
output: [
'nanoarrow.c',
'nanoarrow_c.pxd',
'nanoarrow_device.c',
'nanoarrow_device_c.pxd',
'nanoarrow_device.h',
'nanoarrow_device.hpp',
'nanoarrow.h',
'nanoarrow.hpp',
'nanoarrow_ipc.c',
'nanoarrow_ipc.h',
'nanoarrow_ipc.hpp',
],
command: [
py,
meson.current_source_dir() + '/../../bootstrap.py',
'--output-dir', meson.current_build_dir()
],
)

nanoarrow_pyx_dep = declare_dependency(
sources: vendored_files[1],
)

cyfiles = [
'_array.pyx',
'_array_stream.pyx',
Expand All @@ -63,16 +37,14 @@ cyfiles = [
cython_args = [
'--include-dir',
meson.current_source_dir(),
'--include-dir',
meson.current_build_dir(),
]
if get_option('buildtype') in ['debug', 'debugoptimized']
cython_args += ['--gdb']
endif

fs = import('fs')
foreach cyf : cyfiles
cyfile_deps = [nanoarrow_pyx_dep, nanoarrow_dep]
cyfile_deps = [nanoarrow_dep]

stem = fs.stem(cyf)
if stem in ['_array', '_device']
Expand Down
Loading

0 comments on commit 287e062

Please sign in to comment.