Skip to content

CMake files-api warning in sdist phase #1130

@eirrgang

Description

@eirrgang

For a very simple project that include tool.scikit-build.sdist.cmake = true, the sdist phase of python -m build produced

2025-08-15 09:45:24,342 - scikit_build_core - WARNING - Could not parse CMake file-api

on a Mac with cmake 4.0.3 and Python 3.10.

python -m scikit_build_core.file_api.reply build/.cmake/api/v1/reply produced

...
            | Traceback (most recent call last):
            |   File ".../.venv10/lib/python3.10/site-packages/scikit_build_core/file_api/reply.py", line 71, in make_class
            |     input_dict[field.name] = self._convert_any(
            |   File ".../.venv10/lib/python3.10/site-packages/scikit_build_core/file_api/reply.py", line 104, in _convert_any
            |     return self._convert_any(item, get_args(target)[0])
            |   File ".../.venv10/lib/python3.10/site-packages/scikit_build_core/file_api/reply.py", line 98, in _convert_any
            |     return self.make_class(item, target)
            |   File ".../.venv10/lib/python3.10/site-packages/scikit_build_core/file_api/reply.py", line 88, in make_class
            |     return target(**input_dict)
            | TypeError: Link.__init__() missing 1 required positional argument: 'commandFragments'
            | Failed to convert field 'link' of type typing.Optional[scikit_build_core.file_api.model.codemodel.Link]
            +——————————————————

The TypeError occurs when data[json_field] is {'language': 'CXX'}. I.e. when _convert_any tries to call scikit_build_core.file_api.model.codemodel.Link(language="CXX")

No warning was produced during the build phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions