-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate build system to scikit-build-core (#61)
- Loading branch information
Showing
24 changed files
with
108 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,52 @@ | ||
[project] | ||
name = "arcae" | ||
version = "0.1.0" | ||
authors = [ | ||
{name = "Simon Perkins", email = "[email protected]"} | ||
] | ||
description = "Arrow bindings for casacore" | ||
readme = {file = "README.rst", content-type = "test/rst"} | ||
requires_python = ">= 3.8" | ||
license = {file = "LICENSE"} | ||
classifiers = [ | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3" | ||
] | ||
dependencies = [ | ||
"appdirs", | ||
"click", | ||
"rich", | ||
"pyarrow == 13.0.0" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black == 22.1.0", | ||
"flake8 == 4.0.1", | ||
"tbump" | ||
] | ||
test = [ | ||
"duckdb", | ||
"pytest >= 7.0.0", | ||
"python-casacore >= 3.5.0", | ||
"requests" | ||
] | ||
|
||
[project.scripts] | ||
arcae = "arcae.applications.entrypoint:main" | ||
|
||
[project.urls] | ||
Repository = "https://github.com/ratt-ru/arcae" | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools", | ||
"cmake>=3.18", | ||
"cython>=3.0.2", | ||
"ninja; platform_system!='Windows'", | ||
"numpy>=1.24.1,<2.0.0", | ||
"requires", | ||
"scikit-build>=0.16.7", | ||
"scikit-build-core", | ||
"pyarrow == 13.0.0"] | ||
build-backend = "setuptools.build_meta" | ||
build-backend = "scikit_build_core.build" | ||
|
||
[tools.setuptools.packages] | ||
find = {} | ||
|
||
[tool.scikit-build] | ||
# build-dir = "/tmp/arcae" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) | ||
find_package(PkgConfig REQUIRED) | ||
find_program(CYTHON_FOUND "cython" REQUIRED) | ||
|
||
pkg_check_modules(casacore REQUIRED IMPORTED_TARGET casacore) | ||
|
||
add_custom_command( | ||
OUTPUT arrow_tables.cc | ||
VERBATIM | ||
COMMAND cython ${CMAKE_CURRENT_SOURCE_DIR}/arrow_tables.pyx | ||
--output-file ${CMAKE_CURRENT_BINARY_DIR}/arrow_tables.cc | ||
--cplus -vvv) | ||
|
||
# Check and correct Python_SOABI if it has an .so suffix | ||
if(${Python_SOABI} MATCHES "\\.so$") | ||
string(REGEX REPLACE "\\.so$" "" Python_SOABI_FIXED "${Python_SOABI}") | ||
message(STATUS "Removing extra .so from ${Python_SOABI}") | ||
else() | ||
set(Python_SOABI_FIXED ${Python_SOABI}) | ||
endif() | ||
|
||
message(STATUS "Python_SOABI_FIXED: ${Python_SOABI_FIXED}") | ||
|
||
python_add_library(arrow_tables MODULE arrow_tables.cc) | ||
set_target_properties(arrow_tables PROPERTIES OUTPUT_NAME "arrow_tables.${Python_SOABI_FIXED}") | ||
|
||
target_link_libraries(arrow_tables PUBLIC arcae PkgConfig::casacore) | ||
target_link_directories(arrow_tables PUBLIC ${PYARROW_LIBDIRS}) | ||
target_include_directories(arrow_tables PUBLIC | ||
PkgConfig::casacore | ||
${PYARROW_INCLUDE} | ||
${NUMPY_INCLUDE} | ||
${CMAKE_SOURCE_DIR}/cpp) | ||
target_compile_options(arrow_tables PUBLIC "-D_GLIBCXX_USE_CXX11_ABI=1") | ||
|
||
string(REPLACE " " ";" _PYARROW_LIBS ${PYARROW_LIBS}) | ||
|
||
foreach(PYARROW_LIB ${_PYARROW_LIBS}) | ||
message("Linking arrow_tables against ${PYARROW_LIB}") | ||
target_link_libraries(arrow_tables PUBLIC ${PYARROW_LIB}) | ||
endforeach() | ||
|
||
set_target_properties(arrow_tables PROPERTIES | ||
POSITION_INDEPENDENT_CODE 1) | ||
|
||
install(TARGETS arrow_tables LIBRARY DESTINATION arcae/lib) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters