-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Port build system to Meson #26621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Port build system to Meson #26621
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6665b26
Start transitioning to pyproject.toml
oscargus 044a5e5
BLD: Use Meson to build extensions
QuLogic 7d85c0e
BLD: Install Python files via Meson
QuLogic 05b664f
Try to generate a version from Meson
QuLogic 0c0a9d3
Implement backend setup in matplotlibrc
QuLogic 8830387
Update CI for Meson build
QuLogic 65545dd
DOC: Update documentation for Meson change
QuLogic 01c1ff6
ci: Pin NumPy on Cygwin build
oscargus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Build system ported to Meson | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The build system of Matplotlib has been ported from setuptools to `meson-python | ||
<https://meson-python.readthedocs.io>`_ and `Meson <https://mesonbuild.com>`_. | ||
Consequently, there have been a few changes for development and packaging purposes. | ||
|
||
1. Installation by ``pip`` of packages with ``pyproject.toml`` use `build isolation | ||
greglucas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#build-isolation>`_ | ||
by default, which interferes with editable installation. Thus for developers using | ||
editable installs, it is now necessary to pass the ``--no-build-isolation`` flag to | ||
``pip install``. This means that all build-time requirements must be available in the | ||
environment for an editable install. | ||
2. Build configuration has moved from a custom :file:`mplsetup.cfg` (also configurable | ||
via ``MPLSETUP`` environment variable) to Meson options. These may be specified using | ||
`meson-python's build config settings | ||
<https://meson-python.readthedocs.io/en/stable/how-to-guides/config-settings.html>`_ | ||
for ``setup-args``. See :file:`meson_options.txt` for all options. For example, a | ||
:file:`mplsetup.cfg` containing the following:: | ||
|
||
[rc_options] | ||
backend=Agg | ||
|
||
[libs] | ||
system_qhull = True | ||
|
||
may be replaced by passing the following arguments to ``pip``:: | ||
|
||
--config-settings=setup-args="-DrcParams-backend=Agg" \ | ||
--config-settings=setup-args="-Dsystem-qhull=true" | ||
|
||
Note that you must use ``pip`` >= 23.1 in order to pass more than one setting. | ||
3. Relatedly, Meson's `builtin options <https://mesonbuild.com/Builtin-options.html>`_ | ||
are now used instead of custom options, e.g., the LTO option is now ``b_lto``. | ||
4. On Windows, Meson activates a Visual Studio environment automatically. However, it | ||
will not do so if another compiler is available. See `Meson's documentation | ||
<https://mesonbuild.com/Builtin-options.html#details-for-vsenv>`_ if you wish to | ||
change the priority of chosen compilers. | ||
5. Installation of test data was previously controlled by :file:`mplsetup.cfg`, but has | ||
now been moved to Meson's install tags. To install test data, add the ``tests`` | ||
tag to the requested install (be sure to include the existing tags as below):: | ||
|
||
--config-settings=install-args="--tags=data,python-runtime,runtime,tests" | ||
6. Checking typing stubs with ``stubtest`` does not work easily with editable install. | ||
For the time being, we suggest using a normal (non-editable) install if you wish to | ||
run ``stubtest``. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in the long commit message of e5e0e2f, it was noted that system freetype/qhull were just for quicker testing and should probably have been reverted, so I have not carried that over to here.