meson-python icon indicating copy to clipboard operation
meson-python copied to clipboard

Possibility to include subprojects in sdist

Open awvwgk opened this issue 3 years ago • 4 comments

Is it already possible to include subprojects when building an sdist using this build backend?

Currently I'm exploiting that meson dist will capture the complete repository and add the subprojects with git subtree add --prefix subprojects/dep1 https://github.com/.../dep1 HEAD before running the sdist build.

awvwgk avatar May 20 '22 20:05 awvwgk

Hum, I think we should be doing that, since our sdist is derived from meson dist. We will need to check.

FFY00 avatar Jun 06 '22 22:06 FFY00

I think you need meson dist --include-subprojects for this purpose.

awvwgk avatar Jun 07 '22 08:06 awvwgk

I think this is solved by the recent added capability of passing command line options to Meson. I think this should work:

python -m build -s -Ddist-args=--include-subprojects

or probably better included in the project pyproject.toml:

[tool.meson-python]
args.dist="--include-subprojects"

@awvwgk can you check if this works for you? You need meson-python >= 0.11.0 for this.

dnicolodi avatar Nov 25 '22 08:11 dnicolodi

I admit that the UI for passing command line options to Meson is just terrible. And this was the reason why I would have liked the documentation to be written before a release with this functionality was released. I know we are constrained by what pep517 (does not) specify and what the implementations do, but at least some consistency would have been nice.

Why do we use the dist-args on the command line but args.dist in pyproject.toml? Wouldn't it have been better to use args-dist on command line? Heck, we could have even used dist.args using the dot as a "namespace separator" in the command line too.

Also, why isn't the pyproject.toml table entry called meson.dist.args? It makes a ton more sense to me for it to be called that way.

dnicolodi avatar Nov 25 '22 08:11 dnicolodi

This is solved by the support for passing arguments to meson dist.

dnicolodi avatar Feb 14 '23 22:02 dnicolodi