[Numpy-svn] r8555 - trunk/numpy/distutils
numpy-svn at scipy.org
numpy-svn at scipy.org
Sat Jul 31 06:02:42 EDT 2010
Author: rgommers
Date: 2010-07-31 05:02:42 -0500 (Sat, 31 Jul 2010)
New Revision: 8555
Modified:
trunk/numpy/distutils/npy_pkg_config.py
Log:
DOC: wiki merge, add distutils.npy_pkg_config.read_config docstring.
Modified: trunk/numpy/distutils/npy_pkg_config.py
===================================================================
--- trunk/numpy/distutils/npy_pkg_config.py 2010-07-31 05:35:06 UTC (rev 8554)
+++ trunk/numpy/distutils/npy_pkg_config.py 2010-07-31 10:02:42 UTC (rev 8555)
@@ -325,12 +325,12 @@
if not vars.has_key("pkgdir") and vars.has_key("pkgname"):
pkgname = vars["pkgname"]
if not pkgname in sys.modules:
- raise ValueError("You should import %s to get information on %s" %
+ raise ValueError("You should import %s to get information on %s" %
(pkgname, meta["name"]))
mod = sys.modules[pkgname]
vars["pkgdir"] = _escape_backslash(os.path.dirname(mod.__file__))
-
+
return LibraryInfo(name=meta["name"], description=meta["description"],
version=meta["version"], sections=sections, vars=VariableSet(vars))
@@ -340,6 +340,44 @@
# problem in practice
_CACHE = {}
def read_config(pkgname, dirs=None):
+ """
+ Return library info for a package from its configuration file.
+
+ Parameters
+ ----------
+ pkgname : str
+ Name of the package (should match the name of the .ini file, without
+ the extension, e.g. foo for the file foo.ini).
+ dirs : sequence, optional
+ If given, should be a sequence of directories - usually including
+ the NumPy base directory - where to look for npy-pkg-config files.
+
+ Returns
+ -------
+ pkginfo : class instance
+ The `LibraryInfo` instance containing the build information.
+
+ Raises
+ ------
+ PkgNotFound
+ If the package is not found.
+
+ See Also
+ --------
+ misc_util.get_info, misc_util.get_pkg_info
+
+ Examples
+ --------
+ >>> npymath_info = np.distutils.npy_pkg_config.read_config('npymath')
+ >>> type(npymath_info)
+ <class 'numpy.distutils.npy_pkg_config.LibraryInfo'>
+ >>> print npymath_info
+ Name: npymath
+ Description: Portable, core math library implementing C99 standard
+ Requires:
+ Version: 0.1 #random
+
+ """
try:
return _CACHE[pkgname]
except KeyError:
More information about the Numpy-svn
mailing list