Skip to content

Commit 4a4733d

Browse files
dnicolodirgommers
authored andcommitted
DOC: limitations: correct paragraph about data files
1 parent 72d5748 commit 4a4733d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
'sphinx_copybutton',
4242
'sphinx_design',
4343
'sphinxext.opengraph',
44+
'sphinx.ext.intersphinx',
4445
]
4546

4647

@@ -64,6 +65,8 @@
6465

6566
todo_include_todos = True
6667

68+
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
69+
6770
# -- Options for HTML output -------------------------------------------------
6871

6972
# The theme to use for HTML and HTML Help pages. See the documentation for

docs/reference/limitations.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ Limitations
99
***********
1010

1111

12-
No data
13-
=======
12+
Non-package data files
13+
======================
1414

15-
Data, as installed by |install_data|_, is not supported. It is
16-
recommended to install data files alongside the Python modules that
17-
requires them, and use :py:mod:`importlib.resources` (or the
18-
:py:mod:`importlib_resources` backport) to access it.
15+
It is possible to encapsulate arbitrary data files into Python
16+
wheels. ``meson-python`` will add to the wheel any data file installed
17+
into the Meson's ``{datadir}`` location, for example via Meson's
18+
|install_data()|_ function. However, when the resulting wheel is
19+
installed, these files are unpacked into a platform-specific location
20+
and there is no supported facility to reliably find them at run time.
21+
22+
It is recommended to include data files than need to be accessible at
23+
run-time inside the package alongside the Python code, and use
24+
:mod:`importlib.resources` (or the `importlib-resources`_ backport) to
25+
access them.
1926

2027

2128
Shared libraries on Windows
@@ -32,8 +39,8 @@ shared libraries and include the setup code to properly set the
3239
library search path.
3340

3441

35-
.. _install_data: https://mesonbuild.com/Reference-manual_functions.html#install_data
42+
.. _install_data(): https://mesonbuild.com/Reference-manual_functions.html#install_data
3643
.. _importlib-resources: https://importlib-resources.readthedocs.io/en/latest/index.html
3744
.. _delvewheel: https://github.com/adang1345/delvewheel
3845

39-
.. |install_data| replace:: ``install_data``
46+
.. |install_data()| replace:: ``install_data()``

0 commit comments

Comments
 (0)