SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib > > python3.11 > site-packages > numpy > distutils > tests


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib//python3.11/site-packages/numpy/distutils/tests

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 0 bytes April 17 2025 13:10:58.
test_build_ext.py File 2769 bytes April 17 2025 13:10:58.
test_ccompiler_opt.py File 28778 bytes April 17 2025 13:10:58.
test_ccompiler_opt_conf.py File 6347 bytes April 17 2025 13:10:58.
test_exec_command.py File 7395 bytes April 17 2025 13:10:58.
test_fcompiler.py File 1277 bytes April 17 2025 13:10:58.
test_fcompiler_gnu.py File 2136 bytes April 17 2025 13:10:58.
test_fcompiler_intel.py File 1058 bytes April 17 2025 13:10:58.
test_fcompiler_nagfor.py File 1102 bytes April 17 2025 13:10:58.
test_from_template.py File 1103 bytes April 17 2025 13:10:58.
test_log.py File 868 bytes April 17 2025 13:10:58.
test_mingw32ccompiler.py File 1609 bytes April 17 2025 13:10:58.
test_misc_util.py File 3218 bytes April 17 2025 13:10:58.
test_npy_pkg_config.py File 2557 bytes April 17 2025 13:10:58.
test_shell_utils.py File 2114 bytes April 17 2025 13:10:58.
test_system_info.py File 10999 bytes April 17 2025 13:10:58.

Reading File: //opt/cloudlinux/venv/lib//python3.11/site-packages/numpy/distutils/tests/test_npy_pkg_config.py

import os

from numpy.distutils.npy_pkg_config import read_config, parse_flags
from numpy.testing import temppath, assert_

simple = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1

[default]
cflags = -I/usr/include
libs = -L/usr/lib
"""
simple_d = {'cflags': '-I/usr/include', 'libflags': '-L/usr/lib',
        'version': '0.1', 'name': 'foo'}

simple_variable = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1

[variables]
prefix = /foo/bar
libdir = ${prefix}/lib
includedir = ${prefix}/include

[default]
cflags = -I${includedir}
libs = -L${libdir}
"""
simple_variable_d = {'cflags': '-I/foo/bar/include', 'libflags': '-L/foo/bar/lib',
        'version': '0.1', 'name': 'foo'}

class TestLibraryInfo:
    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'])

    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')

class TestParseFlags:
    def test_simple_cflags(self):
        d = parse_flags("-I/usr/include")
        assert_(d['include_dirs'] == ['/usr/include'])

        d = parse_flags("-I/usr/include -DFOO")
        assert_(d['include_dirs'] == ['/usr/include'])
        assert_(d['macros'] == ['FOO'])

        d = parse_flags("-I /usr/include -DFOO")
        assert_(d['include_dirs'] == ['/usr/include'])
        assert_(d['macros'] == ['FOO'])

    def test_simple_lflags(self):
        d = parse_flags("-L/usr/lib -lfoo -L/usr/lib -lbar")
        assert_(d['library_dirs'] == ['/usr/lib', '/usr/lib'])
        assert_(d['libraries'] == ['foo', 'bar'])

        d = parse_flags("-L /usr/lib -lfoo -L/usr/lib -lbar")
        assert_(d['library_dirs'] == ['/usr/lib', '/usr/lib'])
        assert_(d['libraries'] == ['foo', 'bar'])

SILENT KILLER Tool