forked from mesonbuild/meson-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes mesonbuild#197, mesonbuild#230, mesonbuild#253, and mesonbuild#264 Sets us up to fix mesonbuild#138, mesonbuild#233, and mesonbuild#224 Signed-off-by: Filipe Laíns <lains@riseup.net>
- Loading branch information
Showing
31 changed files
with
1,189 additions
and
329 deletions.
There are no files selected for viewing
This file contains 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 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 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,14 @@ | ||
.. _contributing-commit-format: | ||
|
||
************* | ||
Commit format | ||
************* | ||
|
||
|
||
.. todo:: | ||
|
||
- Explain is the same as Numpy and SciPy | ||
- List valid prefixes | ||
- Speak a bit about message clarity | ||
- Speak a bit about splitting commits into logical changes | ||
- Mention we require a linear history |
This file contains 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,32 @@ | ||
.. _contributing-documentation: | ||
|
||
************* | ||
Documentation | ||
************* | ||
|
||
Our documentation is built on sphinx_, is written using reStructuredText_, and | ||
follows the Diátaxis_ framework. | ||
|
||
To automatically re-build the documentation and serve it on an web server, you | ||
can pass the ``serve`` argument to the ``docs`` nox_ task. | ||
|
||
|
||
.. code-block:: console | ||
$ nox -s docs -- serve | ||
When using this argument, the task will watch the documentation source files, | ||
and every time you edit something, it will automatically re-build the | ||
documentation and make it available on the provided web server. | ||
|
||
|
||
.. todo:: | ||
|
||
Elaborate more with tips on how to write. | ||
|
||
|
||
.. _sphinx: https://www.sphinx-doc.org | ||
.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html | ||
.. _Diátaxis: https://diataxis.fr/ | ||
.. _nox: https://github.com/wntrblm/nox |
This file contains 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,11 @@ | ||
.. _contributing-getting-started: | ||
|
||
*************** | ||
Getting started | ||
*************** | ||
|
||
|
||
.. todo:: | ||
|
||
- Introduction to the development workflow. | ||
- ? |
This file contains 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,12 @@ | ||
.. _contributing-test-suite: | ||
|
||
********** | ||
Test suite | ||
********** | ||
|
||
|
||
.. todo:: | ||
|
||
- Introduce nox | ||
- Explain our most relevant pytest fixtures (``package_*``, ``sdist_*``, | ||
``wheel_*``, ``editable_*``, ``venv``, etc.) |
This file contains 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,82 @@ | ||
:orphan: | ||
|
||
.. _explanations-design-old: | ||
|
||
******************************* | ||
How does ``meson-python`` work? | ||
******************************* | ||
|
||
|
||
.. admonition:: Old documentation | ||
:class: attention | ||
|
||
You are looking at the old documentation. We are currently in the process of | ||
refactoring the whole documentation and this page was part of the old | ||
version. While it still contains lots of relevant information, it is not | ||
necessarily in the format we ultimately want to present, and is not well | ||
integrated with the other parts of the documentation. | ||
|
||
|
||
|
||
How does it work? | ||
================= | ||
|
||
We implement the Python build system hooks, enabling any standards compliant | ||
Python tool (pip_, `pypa/build`_, etc.) to build and install the project. | ||
|
||
``meson-python`` will build a Python sdist (source distribution) or | ||
wheel (binary distribution) from Meson_ project. | ||
|
||
Source distribution (sdist) | ||
--------------------------- | ||
|
||
The source distribution is based on ``meson dist``, so make sure all your files | ||
are included there. In git projects, Meson_ will not include files that are not | ||
checked into git, keep that in mind when developing. By default, all files | ||
under version control will be included in the sdist. In order to exclude files, | ||
use ``export-ignore`` or ``export-subst`` attributes in ``.gitattributes`` (see | ||
the ``git-archive`` documentation for details; ``meson dist`` uses | ||
``git-archive`` under the hood). | ||
|
||
Local (uncommitted) changes to files that are under version control will be | ||
included. This is often needed when applying patches, e.g. for build issues | ||
found during packaging, to work around test failures, to amend the license for | ||
vendored components in wheels, etc. | ||
|
||
Binary distribution (wheels) | ||
---------------------------- | ||
|
||
The binary distribution is built by running Meson_ and introspecting the build | ||
and trying to map the files to their correct location. Due to some limitations | ||
and/or bugs in Meson_, we might not be able to map some of the files with | ||
certainty. In these cases, we will take the safest approach and warn the user. | ||
In some cases, we might need to resort to heuristics to perform the mapping, | ||
similarly, the user will be warned. These warnings are not necessarily a reason | ||
for concern, they are there to help identifying issues. In these cases, we | ||
recommend that you check if the files in question were indeed mapped to the | ||
expected place, and open a bug report if they weren't. | ||
|
||
If the project itself includes shared libraries that are needed by other files, | ||
those libraries will be included in the wheel, and native files will have their | ||
library search path extended to include the directory where the libraries are | ||
placed. | ||
|
||
If the project depends on external shared libraries, those libraries will not | ||
be included in the wheel. This can be handled in several ways by the package | ||
developer using ``meson-python``: | ||
|
||
1. Finding or creating a suitable Python package that provides those shared | ||
libraries and can be added to ``dependencies`` in ``pyproject.toml``. | ||
2. Vendoring those libraries into the wheel. Currently ``meson-python`` does | ||
not provide an OS-agnostic way of doing that; on Linux ``auditwheel`` can be | ||
used, and on macOS ``delocate``. Or, the package developer can copy the | ||
shared libraries into the source tree and patch ``meson.build`` files to | ||
include them. | ||
3. Documenting that the dependency is assumed to already be installed on the | ||
end user's system, and letting the end user install it themselves (e.g., | ||
through their Linux distro package manager). | ||
|
||
|
||
.. _pip: https://github.com/pypa/pip | ||
.. _pypa/build: https://github.com/pypa/build | ||
.. _Meson: https://github.com/mesonbuild/meson |
This file contains 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,22 @@ | ||
.. _explanations-design: | ||
|
||
******************************* | ||
How does ``meson-python`` work? | ||
******************************* | ||
|
||
|
||
.. todo:: | ||
|
||
- Explain how ``meson-python`` maps files to the wheel | ||
|
||
- Link to :ref:`tutorials-executable` in the relevant section | ||
|
||
- Explain why the heuristics are necessary and how they work | ||
- Explain why we don't support ``install_data`` | ||
|
||
- Link to the relevant :ref:`reference-limitations` section | ||
|
||
- ? | ||
|
||
|
||
You can find the old documentation :ref:`here <explanations-design-old>`. |
This file contains 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,15 @@ | ||
.. _explanations-editable-installs: | ||
|
||
****************************** | ||
How do editable installs work? | ||
****************************** | ||
|
||
|
||
.. todo:: | ||
|
||
- Explain how the custom finder works | ||
- Explain what is the purpose of the ``_MESONPY_EDITABLE_SKIP`` environment | ||
variable | ||
|
||
- Warn that the approach described is purely informational, and should | ||
not be relied on |
This file contains 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,13 @@ | ||
.. _explanations-internal-dependencies: | ||
|
||
*************************************** | ||
How do we handle internal dependencies? | ||
*************************************** | ||
|
||
|
||
.. todo:: | ||
|
||
- Explain why bundle internal dependencies | ||
- Explain how we bundle internal dependencies | ||
|
||
- Explain how we patch the ``RPATH`` |
This file contains 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,13 @@ | ||
.. _how-to-guides-add-dependencies: | ||
|
||
******************* | ||
Adding dependencies | ||
******************* | ||
|
||
|
||
.. todo:: | ||
|
||
- Mention how to add dependencies | ||
- Mention how to add optional dependencies | ||
- Mention how to add build dependencies | ||
- Give a quick introduction to the Python dependency specification format |
This file contains 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,14 @@ | ||
.. _how-to-guides-build-directory: | ||
|
||
******************************* | ||
Use a permanent build directory | ||
******************************* | ||
|
||
|
||
.. todo:: | ||
|
||
- Explain why you want to use the ``builddir`` option | ||
- Explain how ``builddir`` works | ||
- Warn that user-configured build directories are not "use at your own risk" | ||
- Warn that ``meson-python`` version mismatches in the build directory can | ||
cause trouble |
This file contains 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,45 @@ | ||
.. _how-to-guides-config-settings: | ||
|
||
************************* | ||
Use build config settings | ||
************************* | ||
|
||
Build config settings are settings you can pass to ``meson-python`` when | ||
building your project. They can be use to customize the build in some aspect. | ||
|
||
The way you specify them depends on which tool you are using, here are the most | ||
popular ones. | ||
|
||
|
||
`pypa/build`_ | ||
============= | ||
|
||
On `pypa/build`_, they can be used via the ``-C``/``--config-setting`` option. | ||
|
||
|
||
.. code-block:: console | ||
$ python -m build -Ckey=value | ||
Please check the `pypa/build documentation`_ for more information. | ||
|
||
|
||
pip_ | ||
==== | ||
|
||
On `pip`_, they can be used via the ``--config-settings`` option. | ||
|
||
|
||
.. code-block:: console | ||
$ pip install . --config-settings key=value | ||
Please check the `pypa/build documentation`_ for more information. | ||
|
||
|
||
.. _pypa/build: https://github.com/pypa/build | ||
.. _pypa/build documentation: https://pypa-build.readthedocs.io/en/stable/ | ||
.. _pip: https://github.com/pypa/pip | ||
.. _pip documentation: https://pip.pypa.io/ |
Oops, something went wrong.