Build sdist without requiring all build dependencies #649
Replies: 5 comments 3 replies
-
From docs/how-to-guides/sdist.rst: "To generate a source distribution, It can't be avoided, since we need to run I'll also link gh-567 as a related discussion, which may contain a few answers to related questions.
That does not yield a valid sdist, and may or may not work for Sage depending on what you may add to CI images have compilers and other dev tools; if it's really a problem to have non-standard dependencies like if get_option('skip-detecting-deps')
# Only for more easily generating an sdist in CI without having `flint` installed
flint_dep = []
else
flint_dep = dependency('flint')
endif and then you can build the sdist with:
|
Beta Was this translation helpful? Give feedback.
-
Could it be that the dependencies are declared as optional but still required when actually attempting to build the extension modules but not for making an sdist? |
Beta Was this translation helpful? Give feedback.
-
Well, that's what my snippet above does. It cannot be done without a single line of code changing, since |
Beta Was this translation helpful? Give feedback.
-
Maybe there could be a general meson configuration option for building a source distribution like Currently it seems that meson dist runs a full configure, then cythonises all the files before ignoring cython's outputs and putting only the cython sources into the dist. I don't know enough about the internal architecture to understand why that happens but it seems like it should not be necessary. |
Beta Was this translation helpful? Give feedback.
-
Unless you are doing something very unusual (and most likely very wrong) in your |
Beta Was this translation helpful? Give feedback.
-
Maybe I missed how to do this but is there a way to build an sdist without requiring all of the build dependencies to be present?
I would have thought that it should be possible without going through a full configure since it should be the consumer of the sdist who would do the configure when trying to build from it.
Here is what currently happens with python-flint:
These CI steps have to do a lot of work just to package up the files for the sdist:
https://github.com/flintlib/python-flint/blob/430b8e50f4d8e697d4f5c7666d7b75f3e440a260/.github/workflows/buildwheel.yml#L67-L73
This PR is to work around this problem in another situation by using
git archive
instead of asking meson-python to build the sdist: flintlib/python-flint#158Beta Was this translation helpful? Give feedback.
All reactions