summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-07-26 11:18:25 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-07-26 11:18:25 +0000
commitab6878ee613fa348ee1ca59dcb77d44a221d06a3 (patch)
tree690eae69878b6b501a00a2884ed1a8db1150cf7b
parent50d010c72dc3649cecf247cc637458ba98a15f2a (diff)
downloadnumpy-ab6878ee613fa348ee1ca59dcb77d44a221d06a3.tar.gz
Fix get_config.
-rw-r--r--numpy/distutils/misc_util.py9
-rw-r--r--numpy/distutils/npy_pkg_config.py12
2 files changed, 11 insertions, 10 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
index f3a3e04c2..218d14011 100644
--- a/numpy/distutils/misc_util.py
+++ b/numpy/distutils/misc_util.py
@@ -13,9 +13,6 @@ try:
except NameError:
from sets import Set as set
-from numpy.distutils.npy_pkg_config import get_info as get_npy_info, parse_flags, \
- PkgNotFound
-
__all__ = ['Configuration', 'get_numpy_include_dirs', 'default_config_dict',
'dict_append', 'appendpath', 'generate_config_py',
'get_cmd', 'allpath', 'get_mathlibs',
@@ -1562,10 +1559,14 @@ def get_info(pkgname):
>>> npymath_info = get_info('npymath')
>>> config.add_extension('foo', sources=['foo.c'], extra_info=npymath_info)
"""
+ # XXX: import here for bootstrapping reasons
import numpy
+ from numpy.distutils.npy_pkg_config import read_config, parse_flags, \
+ PkgNotFound
+
d = os.path.join(
os.path.dirname(numpy.__file__), 'core', 'lib', 'npy-pkg-config')
- pkg_info = get_npy_info(pkgname, [d])
+ pkg_info = read_config(pkgname, [d])
# Translate LibraryInfo instance into a build_info dict
info = parse_flags(pkg_info.cflags())
diff --git a/numpy/distutils/npy_pkg_config.py b/numpy/distutils/npy_pkg_config.py
index 2e4585e06..616fdaddb 100644
--- a/numpy/distutils/npy_pkg_config.py
+++ b/numpy/distutils/npy_pkg_config.py
@@ -4,7 +4,7 @@ import os
import shlex
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet',
- 'get_info', 'parse_flags']
+ 'read_config', 'parse_flags']
_VAR = re.compile('\$\{([a-zA-Z0-9_-]+)\}')
@@ -200,7 +200,7 @@ def parse_config(filename, dirs=None):
return meta, vars, sections, requires
-def read_config(filenames, dirs=None):
+def _read_config_imp(filenames, dirs=None):
def _read_config(f):
meta, vars, sections, reqs = parse_config(f, dirs)
# recursively add sections and variables of required libraries
@@ -228,11 +228,11 @@ def read_config(filenames, dirs=None):
# be parsed many time outside LibraryInfo creation, but I doubt this will be a
# problem in practice
_CACHE = {}
-def get_info(pkgname, dirs=None):
+def read_config(pkgname, dirs=None):
try:
return _CACHE[pkgname]
except KeyError:
- v = read_config(pkg_to_filename(pkgname), dirs)
+ v = _read_config_imp(pkg_to_filename(pkgname), dirs)
_CACHE[pkgname] = v
return v
@@ -277,9 +277,9 @@ if __name__ == '__main__':
import os
d = os.environ.get('NPY_PKG_CONFIG_PATH')
if d:
- info = get_info(pkg_name, ['numpy/distutils', '.', d])
+ info = read_info(pkg_name, ['numpy/core/lib/npy-pkg-config', '.', d])
else:
- info = get_info(pkg_name, ['numpy/distutils', '.'])
+ info = read_info(pkg_name, ['numpy/core/lib/npy-pkg-config', '.'])
if options.section:
section = options.section