From cf2a9b2e0e1ef55c9571e020f865cf1bb7393432 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:10:52 +0000 Subject: [PATCH 1/4] Initial plan From bcb90613447e876da45807a3628193d75614034f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:14:54 +0000 Subject: [PATCH 2/4] Add pyproject packaging for pip install Agent-Logs-Url: https://github.com/Rahuldrabit/Genetic_algorithm/sessions/ce7003a6-f372-4c5c-91c5-95f5c19e1238 Co-authored-by: Rahuldrabit <104688569+Rahuldrabit@users.noreply.github.com> --- CMakeLists.txt | 11 +++++++++++ pyproject.toml | 27 +++++++++++++++++++++++++++ python/README.md | 20 ++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 pyproject.toml diff --git a/CMakeLists.txt b/CMakeLists.txt index 45a93a9..a2da11f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,17 @@ if(pybind11_FOUND) OUTPUT_NAME "ga" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python" ) + if(SKBUILD) + install(TARGETS ga_python_module + LIBRARY DESTINATION . + RUNTIME DESTINATION . + ) + else() + install(TARGETS ga_python_module + LIBRARY DESTINATION lib/python + RUNTIME DESTINATION lib/python + ) + endif() message(STATUS "Python bindings: ENABLED (pybind11 ${pybind11_VERSION})") else() message(STATUS "Python bindings: DISABLED (pybind11 not found — install with: pip install pybind11)") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0eb3f9a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["scikit-build-core>=0.10", "pybind11>=2.6"] +build-backend = "scikit_build_core.build" + +[project] +name = "genetic-algorithm" +version = "1.0.0" +description = "Genetic Algorithm framework with C++ core and Python bindings" +readme = "README.md" +requires-python = ">=3.8" +license = { text = "MIT" } +authors = [{ name = "Rahuldrabit" }] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: C++", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering", +] + +[project.urls] +Homepage = "https://github.com/Rahuldrabit/Genetic_algorithm" +Repository = "https://github.com/Rahuldrabit/Genetic_algorithm" +Issues = "https://github.com/Rahuldrabit/Genetic_algorithm/issues" + +[tool.scikit-build] +wheel.packages = [] diff --git a/python/README.md b/python/README.md index 1f18a17..8b2bfce 100644 --- a/python/README.md +++ b/python/README.md @@ -14,6 +14,26 @@ cmake --build build --target ga_python_module The module is produced under `build/python`. +## Install with pip + +From the repository root: + +```bash +python3 -m pip install . +``` + +Or for editable/development install: + +```bash +python3 -m pip install -e . +``` + +Then import directly: + +```python +import ga +``` + ## Example Run the bundled example: From 101eb13ee4204f2a128fa88b66073f37a22036e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:16:18 +0000 Subject: [PATCH 3/4] Clarify wheel packaging intent in pyproject Agent-Logs-Url: https://github.com/Rahuldrabit/Genetic_algorithm/sessions/ce7003a6-f372-4c5c-91c5-95f5c19e1238 Co-authored-by: Rahuldrabit <104688569+Rahuldrabit@users.noreply.github.com> --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0eb3f9a..6d7219e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,4 +24,5 @@ Repository = "https://github.com/Rahuldrabit/Genetic_algorithm" Issues = "https://github.com/Rahuldrabit/Genetic_algorithm/issues" [tool.scikit-build] +# This project ships a compiled extension module (`ga`) and no pure-Python package tree. wheel.packages = [] From 924b32b111b176760f355cdb5fbe4d3c64919d7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:26:23 +0000 Subject: [PATCH 4/4] Align Python package license metadata with Apache-2.0 Agent-Logs-Url: https://github.com/Rahuldrabit/Genetic_algorithm/sessions/f8a85f6c-904c-4298-aa08-e5245c7b0dc6 Co-authored-by: Rahuldrabit <104688569+Rahuldrabit@users.noreply.github.com> --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6d7219e..3c5e72b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,12 +8,12 @@ version = "1.0.0" description = "Genetic Algorithm framework with C++ core and Python bindings" readme = "README.md" requires-python = ">=3.8" -license = { text = "MIT" } +license = { text = "Apache-2.0" } authors = [{ name = "Rahuldrabit" }] classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: C++", - "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Topic :: Scientific/Engineering", ]