Skip to content

Align Python package license metadata with Apache-2.0#15

Merged
Rahuldrabit merged 4 commits intomainfrom
copilot/packaging-make-it-pip-installable
Mar 28, 2026
Merged

Align Python package license metadata with Apache-2.0#15
Rahuldrabit merged 4 commits intomainfrom
copilot/packaging-make-it-pip-installable

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

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

    • Updated pyproject.toml project license from MIT to Apache-2.0.
    • Replaced MIT Trove classifier with Apache classifier.
  • Impact

    • PyPI-visible metadata now matches the legal license shipped in the root LICENSE file.
    • Avoids downstream ambiguity for consumers and compliance tooling.
[project]
license = { text = "Apache-2.0" }
classifiers = [
  "License :: OSI Approved :: Apache Software License",
]

🔒 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.

Copilot AI and others added 2 commits March 28, 2026 13:14
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>
Copilot AI changed the title [WIP] Add packaging to make it pip-installable Add PEP 517 packaging to make ga pip-installable and PyPI-ready Mar 28, 2026
Copilot AI requested a review from Rahuldrabit March 28, 2026 13:17
@Rahuldrabit
Copy link
Copy Markdown
Owner

@copilot review

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 28, 2026

@copilot review

Reviewed the current branch at 101eb13 and re-validated packaging/install flow (pip install ., import ga, python/bindings_sanity.py). No additional code changes are needed.

Copilot AI changed the title Add PEP 517 packaging to make ga pip-installable and PyPI-ready Align Python package license metadata with Apache-2.0 Mar 28, 2026
@Rahuldrabit Rahuldrabit marked this pull request as ready for review March 28, 2026 13:28
Copilot AI review requested due to automatic review settings March 28, 2026 13:28
@Rahuldrabit Rahuldrabit merged commit e6c4724 into main Mar 28, 2026
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.toml license 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.

Comment on lines +177 to +187
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()
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +183 to +186
install(TARGETS ga_python_module
LIBRARY DESTINATION lib/python
RUNTIME DESTINATION lib/python
)
Copy link

Copilot AI Mar 28, 2026

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/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.

Suggested change
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()

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +29
Or for editable/development install:

```bash
python3 -m pip install -e .
```
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@Rahuldrabit Rahuldrabit deleted the copilot/packaging-make-it-pip-installable branch March 29, 2026 16:54
@Rahuldrabit Rahuldrabit restored the copilot/packaging-make-it-pip-installable branch March 29, 2026 16:54
@Rahuldrabit Rahuldrabit deleted the copilot/packaging-make-it-pip-installable branch March 30, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants