Skip to content

Commit 23cdd2a

Browse files
committed
init a branch to convert to uv settings (using .toml).
1 parent d95b0e5 commit 23cdd2a

File tree

9 files changed

+995
-6
lines changed

9 files changed

+995
-6
lines changed

.idea/graphkit-learn.iml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
project(graphkit_learn LANGUAGES CXX)
3+
4+
# Set Python version requirements
5+
find_package(Python REQUIRED COMPONENTS Interpreter Development)
6+
7+
# Add the gedlib subdirectory if it exists
8+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gklearn/gedlib/CMakeLists.txt")
9+
add_subdirectory(gklearn/gedlib)
10+
endif()
11+
12+
# Install Python packages
13+
install(DIRECTORY gklearn
14+
DESTINATION ${SKBUILD_PLATLIB_DIR}
15+
PATTERN "*.egg-info" EXCLUDE
16+
PATTERN "*.git*" EXCLUDE
17+
PATTERN "__pycache__" EXCLUDE
18+
PATTERN "*.cpp" EXCLUDE
19+
PATTERN "*.o" EXCLUDE
20+
PATTERN "*.so" EXCLUDE
21+
PATTERN "*.pyc" EXCLUDE)

gklearn/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"""
1212

1313
# info
14-
__version__ = "0.1"
15-
__author__ = "Benoit Gaüzère"
16-
__date__ = "November 2017"
17-
14+
import datetime
15+
16+
__version__ = '0.2.1.post' + datetime.now().strftime('%Y%m%d%H%M%S')
17+
__author__ = 'Linlin Jia, Benoit Gaüzère, Paul Honeine'
18+
__date__ = 'November 2017'
19+
1820
# import sub modules
1921
# from gklearn import c_ext
2022
# from gklearn import ged

gklearn/gedlib/CMakeLists.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
project(gedlibpy LANGUAGES CXX)
3+
4+
# Find Python and dependencies
5+
find_package(Python REQUIRED COMPONENTS Interpreter Development NumPy)
6+
find_package(Cython REQUIRED)
7+
include(UseCython)
8+
9+
# Set Cython language level
10+
set(CYTHON_LANGUAGE_LEVEL "3")
11+
12+
# Include directories
13+
set(GEDLIB_INCLUDE_DIRS
14+
"${CMAKE_CURRENT_SOURCE_DIR}/src"
15+
"${CMAKE_CURRENT_SOURCE_DIR}/include"
16+
"${CMAKE_CURRENT_SOURCE_DIR}/include/lsape.5/include"
17+
"${CMAKE_CURRENT_SOURCE_DIR}/include/eigen.3.3.4/Eigen"
18+
"${CMAKE_CURRENT_SOURCE_DIR}/include/nomad.3.8.1/src"
19+
"${CMAKE_CURRENT_SOURCE_DIR}/include/nomad.3.8.1/ext/sgtelib/src"
20+
"${CMAKE_CURRENT_SOURCE_DIR}/include/libsvm.3.22"
21+
"${CMAKE_CURRENT_SOURCE_DIR}/include/fann.2.2.0/include"
22+
"${CMAKE_CURRENT_SOURCE_DIR}/include/boost.1.69.0"
23+
${Python_NumPy_INCLUDE_DIRS}
24+
)
25+
26+
# Library directories
27+
set(GEDLIB_LIBRARY_DIRS
28+
"${CMAKE_CURRENT_SOURCE_DIR}/lib/fann.2.2.0"
29+
"${CMAKE_CURRENT_SOURCE_DIR}/lib/libsvm.3.22"
30+
"${CMAKE_CURRENT_SOURCE_DIR}/lib/nomad.3.8.1"
31+
)
32+
33+
# Libraries to link
34+
set(GEDLIB_LIBRARIES doublefann sgtelib svm nomad)
35+
36+
# Create the Cython extension module
37+
add_cython_target(gedlibpy CXX)
38+
add_library(gedlibpy MODULE ${gedlibpy})
39+
40+
# Set include directories for the module
41+
target_include_directories(gedlibpy PUBLIC ${GEDLIB_INCLUDE_DIRS})
42+
43+
# Set library directories for the module
44+
target_link_directories(gedlibpy PUBLIC ${GEDLIB_LIBRARY_DIRS})
45+
46+
# Link libraries
47+
target_link_libraries(gedlibpy PUBLIC ${GEDLIB_LIBRARIES} Python::Python)
48+
49+
# Set C++ standard
50+
target_compile_features(gedlibpy PRIVATE cxx_std_11)
51+
52+
# Install the Cython extension
53+
install(TARGETS gedlibpy
54+
LIBRARY DESTINATION ${SKBUILD_PLATLIB_DIR}/gklearn/gedlib
55+
RUNTIME DESTINATION ${SKBUILD_PLATLIB_DIR}/gklearn/gedlib)

gklearn/gedlib/pyproject.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[build-system]
2+
requires = ["scikit-build-core>=0.5.0", "wheel", "setuptools>=42", "cmake>=3.18", "cython>=0.29.0", "numpy"]
3+
build-backend = "scikit_build_core.build"
4+
5+
[project]
6+
name = "gedlibpy"
7+
version = "0.1.0"
8+
authors = [
9+
{name = "Lambert Natacha and Linlin Jia", email = "linlin.jia@unibe.ch"},
10+
]
11+
description = "A Python wrapper library for C++ library GEDLIB of graph edit distances"
12+
readme = "README.rst"
13+
license = {text = "GNU General Public License v3 (GPLv3)"}
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
17+
"Operating System :: OS Independent",
18+
"Intended Audience :: Science/Research",
19+
"Intended Audience :: Developers",
20+
]
21+
requires-python = ">=3.11"
22+
23+
[project.urls]
24+
Source = "https://github.com/jajupmochi/graphkit-learn/tree/master/gklearn/gedlib"
25+
Tracker = "https://github.com/jajupmochi/graphkit-learn/issues"
26+
27+
[tool.scikit-build]
28+
wheel.expand-macos-universal-tags = true
29+
cmake.minimum-version = "3.18"
30+
build-dir = "build/{wheel_tag}"
31+
cmake.verbose = true

pyproject.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[build-system]
2+
requires = ["scikit-build-core>=0.8.0", "wheel", "setuptools>=42", "dynamic-metadata"]
3+
build-backend = "scikit_build_core.build"
4+
5+
[project]
6+
name = "graphkit-learn"
7+
dynamic = ["version"]
8+
authors = [
9+
{ name = "Linlin Jia", email = "jajupmochi@gmail.com" },
10+
]
11+
description = "A Python library for machine learning on graphs."
12+
readme = "README.md"
13+
license = { text = "GNU General Public License v3 (GPLv3)" }
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
17+
"Operating System :: OS Independent",
18+
"Intended Audience :: Science/Research",
19+
"Intended Audience :: Developers",
20+
]
21+
requires-python = ">=3.11"
22+
dependencies = [
23+
"control>=0.10.1",
24+
"cvxopt>=1.3.2",
25+
"cvxpy>=1.6.5",
26+
"cython>=3.1.0",
27+
"matplotlib>=3.10.3",
28+
"mosek>=11.0.20",
29+
"networkx>=3.4.2",
30+
"numpy>=2.2.5",
31+
"scikit-learn>=1.6.1",
32+
"scipy>=1.15.3",
33+
"slycot>=0.6.0",
34+
"tabulate>=0.9.0",
35+
"tqdm>=4.67.1",
36+
]
37+
38+
[project.urls]
39+
Documentation = "https://graphkit-learn.readthedocs.io"
40+
Source = "https://github.com/jajupmochi/graphkit-learn"
41+
Tracker = "https://github.com/jajupmochi/graphkit-learn/issues"
42+
43+
[tool.scikit-build]
44+
wheel.expand-macos-universal-tags = true
45+
cmake.version = ">=3.18"
46+
build-dir = "build/{wheel_tag}"
47+
build.verbose = true
48+
wheel.packages = ["gklearn"]
49+
50+
[tool.scikit-build.sdist]
51+
include = ["gklearn/**/*", "CMakeLists.txt"]
52+
exclude = ["gklearn/gedlib/gedlib-master", "*.cpp", "*.so", "**/*.pyc"]
53+
54+
[tool.scikit-build.cmake.define]
55+
BUILD_SHARED_LIBS = "ON"
56+
57+
[tool.dynamic-metadata.version]
58+
provider = "dynamic_metadata.plugins.regex"
59+
input = "gklearn/__init__.py"
60+
regex = "(?i)^(__version__|VERSION) *= *(['\"])v?(?P<value>.+?)\\2"
61+

0 commit comments

Comments
 (0)