-
Notifications
You must be signed in to change notification settings - Fork 0
Align Python package license metadata with Apache-2.0 #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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() | ||
|
Comment on lines
+177
to
+187
|
||
| message(STATUS "Python bindings: ENABLED (pybind11 ${pybind11_VERSION})") | ||
| else() | ||
| message(STATUS "Python bindings: DISABLED (pybind11 not found — install with: pip install pybind11)") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| [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 = "Apache-2.0" } | ||
| authors = [{ name = "Rahuldrabit" }] | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: C++", | ||
| "License :: OSI Approved :: Apache Software 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] | ||
| # This project ships a compiled extension module (`ga`) and no pure-Python package tree. | ||
| wheel.packages = [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 . | ||
| ``` | ||
|
Comment on lines
+25
to
+29
|
||
|
|
||
| Then import directly: | ||
|
|
||
| ```python | ||
| import ga | ||
| ``` | ||
|
|
||
| ## Example | ||
|
|
||
| Run the bundled example: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-SKBUILD install destination
lib/pythonis unlikely to be on Python’s default import path (it’s not a standard site-packages location), socmake --install/make installwill produce an installed module that typically can’t be imported. Consider installing to the discovered Python site-packages (e.g., CMake’s Python3 site variables) or only defining install rules under SKBUILD if non-skbuild installs aren’t supported.