Skip to content

Generate sdist out of the source tree #1237

@raulcd

Description

@raulcd

At the Apache Arrow project we are trying to move to scikit-build-core as our build backend for PyArrow on the following PR:

This has been great so far but we've found a small issue and wanted to get some feedback on what we could do or whether there's something we could do to accommodate our use case.

The PyArrow project builds bindings for Apache Arrow from the Arrow C++ implementation. We have a monorepo setup and we want to keep a single source for our LICENSES.txt and NOTICE.txt at the root for the project as this will be shipped for other language bindings and implementations and we don't want to keep several copies that can get out of sync.

Currently with setuptools we have a custom command for sdist where we copy the files on the release tree:
https://github.com/apache/arrow/blob/c9dfb3ee8701f0c8049c950558c87037e252f9a5/python/setup.py#L443-L469

The above is done out of the source tree.

We wanted to do something similar with scikit-build-core but when building the sdist it always uses an in source build from what we can see:

paths = sorted(
each_unignored_file(
Path(),
include=settings.sdist.include,
exclude=settings.sdist.exclude,
build_dir=settings.build_dir,
mode=settings.sdist.inclusion_mode,
)
)

The way we've found to copy our Licenses at the moment is to build a custom build backend wrapping scikit-build-core but this is all currently done on the source tree, possibly polluting our source directory with files we don't want to keep.
https://github.com/apache/arrow/pull/49259/changes#diff-2aa6b17a1ee43ca6e6821bef231d956c4cabb71d8ab47ed427b3e2a3ee710392R49

Is there any possibility of doing source distributions out of the source tree? Is this a feature that could be interesting for the project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions