當前位置: 首頁>>代碼示例>>Python>>正文


Python npy_pkg_config.read_config方法代碼示例

本文整理匯總了Python中numpy.distutils.npy_pkg_config.read_config方法的典型用法代碼示例。如果您正苦於以下問題:Python npy_pkg_config.read_config方法的具體用法?Python npy_pkg_config.read_config怎麽用?Python npy_pkg_config.read_config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.distutils.npy_pkg_config的用法示例。


在下文中一共展示了npy_pkg_config.read_config方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_simple

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def test_simple(self):
        fd, filename = mkstemp('foo.ini')
        try:
            pkg = os.path.splitext(filename)[0]
            try:
                os.write(fd, simple.encode('ascii'))
            finally:
                os.close(fd)

            out = read_config(pkg)
            self.assertTrue(out.cflags() == simple_d['cflags'])
            self.assertTrue(out.libs() == simple_d['libflags'])
            self.assertTrue(out.name == simple_d['name'])
            self.assertTrue(out.version == simple_d['version'])
        finally:
            os.remove(filename) 
開發者ID:pfchai,項目名稱:ImageFusion,代碼行數:18,代碼來源:test_npy_pkg_config.py

示例2: test_simple_variable

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def test_simple_variable(self):
        fd, filename = mkstemp('foo.ini')
        try:
            pkg = os.path.splitext(filename)[0]
            try:
                os.write(fd, simple_variable.encode('ascii'))
            finally:
                os.close(fd)

            out = read_config(pkg)
            self.assertTrue(out.cflags() == simple_variable_d['cflags'])
            self.assertTrue(out.libs() == simple_variable_d['libflags'])
            self.assertTrue(out.name == simple_variable_d['name'])
            self.assertTrue(out.version == simple_variable_d['version'])

            out.vars['prefix'] = '/Users/david'
            self.assertTrue(out.cflags() == '-I/Users/david/include')
        finally:
            os.remove(filename) 
開發者ID:pfchai,項目名稱:ImageFusion,代碼行數:21,代碼來源:test_npy_pkg_config.py

示例3: test_simple

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def test_simple(self):
        with temppath('foo.ini') as path:
            with open(path,  'w') as f:
                f.write(simple)
            pkg = os.path.splitext(path)[0]
            out = read_config(pkg)

        assert_(out.cflags() == simple_d['cflags'])
        assert_(out.libs() == simple_d['libflags'])
        assert_(out.name == simple_d['name'])
        assert_(out.version == simple_d['version']) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:13,代碼來源:test_npy_pkg_config.py

示例4: test_simple_variable

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def test_simple_variable(self):
        with temppath('foo.ini') as path:
            with open(path,  'w') as f:
                f.write(simple_variable)
            pkg = os.path.splitext(path)[0]
            out = read_config(pkg)

        assert_(out.cflags() == simple_variable_d['cflags'])
        assert_(out.libs() == simple_variable_d['libflags'])
        assert_(out.name == simple_variable_d['name'])
        assert_(out.version == simple_variable_d['version'])
        out.vars['prefix'] = '/Users/david'
        assert_(out.cflags() == '-I/Users/david/include') 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:15,代碼來源:test_npy_pkg_config.py

示例5: get_pkg_info

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def get_pkg_info(pkgname, dirs=None):
    """
    Return library info for the given package.

    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 additional directories where to look
        for npy-pkg-config files. Those directories are searched prior to the
        NumPy directory.

    Returns
    -------
    pkginfo : class instance
        The `LibraryInfo` instance containing the build information.

    Raises
    ------
    PkgNotFound
        If the package is not found.

    See Also
    --------
    Configuration.add_npy_pkg_config, Configuration.add_installed_library,
    get_info

    """
    from numpy.distutils.npy_pkg_config import read_config

    if dirs:
        dirs.append(get_npy_pkg_dir())
    else:
        dirs = [get_npy_pkg_dir()]
    return read_config(pkgname, dirs) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:39,代碼來源:misc_util.py

示例6: test_simple

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def test_simple(self):
        with temppath('foo.ini') as path:
            with open(path,  'w') as f:
                f.write(simple)
            pkg = os.path.splitext(path)[0]
            out = read_config(pkg)

        self.assertTrue(out.cflags() == simple_d['cflags'])
        self.assertTrue(out.libs() == simple_d['libflags'])
        self.assertTrue(out.name == simple_d['name'])
        self.assertTrue(out.version == simple_d['version']) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:13,代碼來源:test_npy_pkg_config.py

示例7: test_simple_variable

# 需要導入模塊: from numpy.distutils import npy_pkg_config [as 別名]
# 或者: from numpy.distutils.npy_pkg_config import read_config [as 別名]
def test_simple_variable(self):
        with temppath('foo.ini') as path:
            with open(path,  'w') as f:
                f.write(simple_variable)
            pkg = os.path.splitext(path)[0]
            out = read_config(pkg)

        self.assertTrue(out.cflags() == simple_variable_d['cflags'])
        self.assertTrue(out.libs() == simple_variable_d['libflags'])
        self.assertTrue(out.name == simple_variable_d['name'])
        self.assertTrue(out.version == simple_variable_d['version'])
        out.vars['prefix'] = '/Users/david'
        self.assertTrue(out.cflags() == '-I/Users/david/include') 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:15,代碼來源:test_npy_pkg_config.py


注:本文中的numpy.distutils.npy_pkg_config.read_config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。