Skip to content

Add a test package and docs for the "C/C++ lib with optional Python bindings" use case #744

Open
@rgommers

Description

@rgommers

This follows up on the discussion at #728 (comment). The use case is multi-language projects, like the Arrow projects, where the root of the repo contains a core C/C++ library and bindings for Python (and perhaps other languages) are present in sub-directories. This is a fairly common layout:

meson.build
src/
    <some_c_sources>
    meson.build
python/
    <some_python_sources>
    pyproject.toml
    meson.build

The challenge here is to get the top-level library built and linked against. The idea in the linked discussion is to add:

python/
    dist_script.py  # replaces symlink with a copy for sdist generation
    subprojects/
        <symlink with content `../..`>

We've seen other people struggle with this puzzle when trying to adopt meson-python, e.g. in #674. It would be good to have a test package for this project structure, and a bit of documentation to point out how this can be handled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationtests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions