Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit cbf941a

Browse files
committed
try scikit-build-core
1 parent d3464e1 commit cbf941a

File tree

5 files changed

+85
-21
lines changed

5 files changed

+85
-21
lines changed

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ install(
5959
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
6060
)
6161

62-
install(
63-
EXPORT MorphIOTargets
64-
NAMESPACE MorphIO::
65-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MorphIO
66-
)
62+
#install(
63+
# EXPORT MorphIOTargets
64+
# NAMESPACE MorphIO::
65+
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MorphIO
66+
# )
6767

6868
install(
6969
FILES ${CMAKE_CURRENT_LIST_DIR}/CMake/MorphIOConfig.cmake

binds/python/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ if (NOT EXTERNAL_PYBIND11)
22
add_subdirectory(pybind11 EXCLUDE_FROM_ALL)
33
endif()
44

5-
pybind11_add_module(_morphio SYSTEM
5+
pybind11_add_module(_morphio
66
morphio.cpp
7-
87
bind_enums.cpp
98
bind_immutable.cpp
109
bind_misc.cpp
@@ -17,3 +16,5 @@ target_link_libraries(_morphio
1716
PRIVATE morphio_static
1817
PRIVATE pybind11::module
1918
)
19+
20+
install(TARGETS _morphio DESTINATION morphio)

pyproject.toml

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
[build-system]
2-
requires = ["setuptools>=24.2.0", "wheel", "cmake", "ninja"]
2+
requires = [
3+
"scikit-build-core",
4+
"setuptools_scm>=8",
5+
"cmake>=3.14",
6+
"ninja",
7+
"pybind11",
8+
]
9+
build-backend = "scikit_build_core.build"
10+
11+
[project]
12+
name = "MorphIO"
13+
description = "A neuron morphology IO library"
14+
readme = "README.rst"
15+
requires-python = ">=3.8"
16+
license = { file = "LICENSE.txt" }
17+
authors = [
18+
{ name = "Blue Brain Project, EPFL" },
19+
]
20+
classifiers = [
21+
"Development Status :: 2 - Pre-Alpha",
22+
"Intended Audience :: Education",
23+
"Intended Audience :: Science/Research",
24+
"Programming Language :: Python",
25+
"Programming Language :: Python :: 3",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Topic :: Scientific/Engineering :: Bio-Informatics",
29+
"License :: OSI Approved :: Apache Software License v2.0",
30+
]
31+
dynamic = ["version"]
32+
#dependencies = [
33+
# "blueetl-core>=0.1.0",
34+
#]
35+
36+
[tool.setuptools_scm]
37+
#
38+
# install_requires=install_requires,
39+
# extras_require={
40+
# 'docs': ['sphinx-bluebrain-theme'],
41+
# },
42+
# url='https://github.com/BlueBrain/MorphIO/',
43+
# ext_modules=[CMakeExtension('morphio._morphio'),
44+
# ],
45+
# cmdclass={'build_ext': CMakeBuild,
46+
# },
47+
# packages=[],
48+
# license="LGPLv3",
49+
# zip_safe=False,
50+
# use_scm_version=True,
51+
# setup_requires=[
52+
# 'setuptools_scm',
53+
# ],
54+
# python_requires=">=3.8",
55+
#)
56+
57+
[tool.scikit-build]
58+
cmake.targets = ["_morphio"]
59+
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
60+
wheel.packages = [ 'morphio', 'morphio.mut', 'morphio.vasculature' ]
61+
cmake.args = [
62+
"-DHIGHFIVE_EXAMPLES=OFF",
63+
"-DHIGHFIVE_UNIT_TESTS=OFF",
64+
'-DMORPHIO_TESTS=OFF',
65+
]
66+
#sdist.include = ["src/some_generated_file.txt"]
67+
#sdist.exclude = [".github"]
368

469
[tool.pytest.ini_options]
570
testpaths = ["tests"]
71+
72+
#'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
73+
#'-DMORPHIO_VERSION_STRING=' + self.distribution.get_version(),
74+
#'-DPYTHON_EXECUTABLE=' + sys.executable,

setup.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
from setuptools.command.build_ext import build_ext
99

1010

11-
class CMakeExtension(Extension):
12-
def __init__(self, name, sourcedir=''):
13-
Extension.__init__(self, name, sources=[])
14-
self.sourcedir = os.path.abspath(sourcedir)
15-
16-
1711
class CMakeBuild(build_ext):
1812
user_options = build_ext.user_options + [
1913
("cmake-defs=", None, "Additional CMake definitions, comma split")

src/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ foreach(TARGET morphio_shared morphio_static)
114114
target_link_libraries(${TARGET} PUBLIC gsl-lite PRIVATE HighFive lexertl)
115115
endforeach(TARGET)
116116

117-
install(
118-
# DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
119-
TARGETS morphio_shared
120-
EXPORT MorphIOTargets
121-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
122-
PUBLIC_HEADER DESTINATION include
123-
)
117+
#install(
118+
# # DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
119+
# TARGETS morphio_shared
120+
# EXPORT MorphIOTargets
121+
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
122+
# PUBLIC_HEADER DESTINATION include
123+
#)

0 commit comments

Comments
 (0)