Align Python package license metadata with Apache-2.0#15
Conversation
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>
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>
ga pip-installable and PyPI-ready
|
@copilot review |
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>
ga pip-installable and PyPI-readyThere was a problem hiding this comment.
Pull request overview
Updates Python packaging metadata to align with the repository’s Apache-2.0 licensing, and adds supporting packaging/install changes for the pybind11-built ga extension module.
Changes:
- Update
pyproject.tomllicense metadata and Trove classifiers to Apache-2.0. - Add pip install instructions for building/installing the module from the repo root.
- Add CMake install rules to support scikit-build-core (
SKBUILD) wheel installation layout.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
python/README.md |
Documents pip install . / pip install -e . usage for the built ga module. |
pyproject.toml |
Declares scikit-build-core/pybind11 build backend and sets Apache-2.0 license metadata/classifiers. |
CMakeLists.txt |
Adds install(TARGETS ...) rules with an SKBUILD-specific destination. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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() |
There was a problem hiding this comment.
The PR title/description focus on license metadata alignment, but this change set also adds pip install documentation and new CMake install rules for SKBUILD/non-SKBUILD builds. Please update the PR description (or title) to reflect these additional packaging/install behavior changes so reviewers and downstream consumers aren’t surprised.
| install(TARGETS ga_python_module | ||
| LIBRARY DESTINATION lib/python | ||
| RUNTIME DESTINATION lib/python | ||
| ) |
There was a problem hiding this comment.
The non-SKBUILD install destination lib/python is unlikely to be on Python’s default import path (it’s not a standard site-packages location), so cmake --install / make install will 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.
| install(TARGETS ga_python_module | |
| LIBRARY DESTINATION lib/python | |
| RUNTIME DESTINATION lib/python | |
| ) | |
| # For non-SKBUILD installs, install into Python's site-packages directory | |
| unset(_python_install_dir CACHE) | |
| if(Python3_FOUND) | |
| if(Python3_SITEARCH) | |
| set(_python_install_dir "${Python3_SITEARCH}") | |
| elseif(Python3_SITELIB) | |
| set(_python_install_dir "${Python3_SITELIB}") | |
| endif() | |
| endif() | |
| if(DEFINED _python_install_dir) | |
| install(TARGETS ga_python_module | |
| LIBRARY DESTINATION "${_python_install_dir}" | |
| RUNTIME DESTINATION "${_python_install_dir}" | |
| ) | |
| else() | |
| message(WARNING | |
| "Python site-packages directory not found; " | |
| "skipping installation of 'ga_python_module'. " | |
| "Use SKBUILD or ensure Python3_SITEARCH/SITELIB is available." | |
| ) | |
| endif() |
| Or for editable/development install: | ||
|
|
||
| ```bash | ||
| python3 -m pip install -e . | ||
| ``` |
There was a problem hiding this comment.
The README’s pip install -e . guidance can be misleading for scikit-build-core editable installs: editable support is experimental and often requires extra caveats (e.g., recommended --no-build-isolation, rebuild expectations for compiled code, and/or persistent build dir if using rebuild-on-import). Please document these caveats or adjust the wording so users don’t expect automatic rebuild behavior.
The repository now uses an Apache-2.0 root license, but Python packaging metadata still declared MIT. This PR updates package metadata so published wheel/sdist metadata is license-consistent with the repository.
Packaging metadata alignment
pyproject.tomlproject license from MIT to Apache-2.0.Impact
LICENSEfile.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.