From 6894bbc6d396b87464cbc21516d239d5f94f13b7 Mon Sep 17 00:00:00 2001 From: Pierre de Buyl Date: Tue, 3 Mar 2020 14:44:19 +0100 Subject: DOC: Add missing imports, definitions and dummy file (#15616) * DOC: fix imports and defs to pass refguide checks Add empty file foo.c at runtime to run distutils config. --- doc/source/reference/distutils.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'doc/source/reference') diff --git a/doc/source/reference/distutils.rst b/doc/source/reference/distutils.rst index fef3ee5fb..6057c7ed0 100644 --- a/doc/source/reference/distutils.rst +++ b/doc/source/reference/distutils.rst @@ -117,6 +117,11 @@ install the C library, you just use the method `add_installed_library` instead o `add_library`, which takes the same arguments except for an additional ``install_dir`` argument:: + .. hidden in a comment so as to be included in refguide but not rendered documentation + >>> import numpy.distutils.misc_util + >>> config = np.distutils.misc_util.Configuration(None, '', '.') + >>> with open('foo.c', 'w') as f: pass + >>> config.add_installed_library('foo', sources=['foo.c'], install_dir='lib') npy-pkg-config files @@ -180,8 +185,8 @@ Reusing a C library from another package Info are easily retrieved from the `get_info` function in `numpy.distutils.misc_util`:: - >>> info = get_info('npymath') - >>> config.add_extension('foo', sources=['foo.c'], extra_info=**info) + >>> info = np.distutils.misc_util.get_info('npymath') + >>> config.add_extension('foo', sources=['foo.c'], extra_info=info) An additional list of paths to look for .ini files can be given to `get_info`. -- cgit v1.2.1