Skip to content

[Python] Use new scikit-build-core force-include to handle License files instead of custom backend #50493

Closed

Description

@raulcd

Describe the enhancement requested

Scikit-build-core has added the ability to force-include a file out of the source tree. We might be able to remove our custom build backend to manage license and notice files.
See:

Component(s)

Python

Activity

  1. raulcd commented on Jul 13, 2026

    @raulcd
    MemberAuthor

    We still have to maintain the links on python/LICENSE.txt and python/NOTICE.txt, they are still necessary otherwise the project.license-files metadata validation fails:

    Processing ./.
      Added file:///build/python to build tracker '/tmp/pip-build-tracker-2wg3y8uc'
      Created temporary directory: /tmp/pip-modern-metadata-v5_unt9g
      Running command Preparing metadata (pyproject.toml)
      WARNING: tool.scikit-build.metadata is deprecated; use the standard top-level [[tool.dynamic-metadata]] instead
        + Exception Group Traceback (most recent call last):
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
        |     main()
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
        |     json_out["return_val"] = hook(**hook_input["kwargs"])
        |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 175, in prepare_metadata_for_build_wheel
        |     return hook(metadata_directory, config_settings)
        |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/scikit_build_core/build/__init__.py", line 102, in prepare_metadata_for_build_wheel
        |     return _build_wheel_impl(
        |            ^^^^^^^^^^^^^^^^^^
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/scikit_build_core/build/wheel.py", line 267, in _build_wheel_impl
        |     return _build_wheel_impl_impl(
        |            ^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/scikit_build_core/build/wheel.py", line 324, in _build_wheel_impl_impl
        |     metadata = get_standard_metadata(pyproject, settings, build_state=state)
        |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/scikit_build_core/build/metadata.py", line 119, in get_standard_metadata
        |     metadata = StandardMetadata.from_pyproject(
        |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/scikit_build_core/_vendor/pyproject_metadata/__init__.py", line 563, in from_pyproject
        |     error_collector.finalize("Failed to parse pyproject.toml")
        |   File "/opt/conda/envs/arrow/lib/python3.11/site-packages/scikit_build_core/_vendor/pyproject_metadata/errors.py", line 105, in finalize
        |     raise ExceptionGroup(msg, self.errors)
        | ExceptionGroup: Failed to parse pyproject.toml (2 sub-exceptions)
        +-+---------------- 1 ----------------
          | scikit_build_core._vendor.pyproject_metadata.errors.ConfigurationError: Every pattern in "project.license-files" must match at least one file: 'LICENSE.txt' did not match any
          +---------------- 2 ----------------
          | scikit_build_core._vendor.pyproject_metadata.errors.ConfigurationError: Every pattern in "project.license-files" must match at least one file: 'NOTICE.txt' did not match any
          +------------------------------------
      error: subprocess-exited-with-error
      
      × Preparing metadata (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> No available output.
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      full command: /opt/conda/envs/arrow/bin/python /opt/conda/envs/arrow/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmppyo15mt4
      cwd: /build/python
      Preparing metadata (pyproject.toml) ... error
    error: metadata-generation-failed
    
    × Encountered error while generating package metadata.
    ╰─> from file:///build/python
  2. added a commit that references this issue on Jul 20, 2026
  3. added this to the 26.0.0 milestone on Jul 20, 2026
  4. raulcd commented on Jul 20, 2026

    @raulcd
    MemberAuthor

    Issue resolved by pull request 50494
    #50494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions