Пример #1
0
def get_scons_build_dir():
    """Return the top path where everything produced by scons will be put.

    The path is relative to the top setup.py"""
    from numscons import get_scons_build_dir

    return get_scons_build_dir()
Пример #2
0
def get_distutils_libdir(cmd, sconscript_path):
    """Returns the path where distutils install libraries, relatively to the
    scons build directory."""
    from numscons import get_scons_build_dir
    scdir = pjoin(get_scons_build_dir(), pdirname(sconscript_path))
    n = scdir.count(os.sep)
    return pjoin(os.sep.join([os.pardir for i in range(n + 1)]), cmd.build_lib)
Пример #3
0
def get_scons_pkg_build_dir(pkg):
    """Return the build directory for the given package (foo.bar).

    The path is relative to the top setup.py"""
    from numscons.core.utils import pkg_to_path

    return pjoin(get_scons_build_dir(), pkg_to_path(pkg))
Пример #4
0
 def add_ufunc_api():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     h_file = join(scons_build_dir, local_dir, '__ufunc_api.h')
     t_file = join(scons_build_dir, local_dir, 'ufunc_api.txt')
     config.add_data_files((header_dir, h_file), (header_dir, t_file))
Пример #5
0
def get_distutils_libdir(cmd, pkg):
    """Returns the path where distutils install libraries, relatively to the
    scons build directory."""
    from numscons import get_scons_build_dir
    from numscons.core.utils import pkg_to_path
    scdir = pjoin(get_scons_build_dir(), pkg_to_path(pkg))
    n = scdir.count(os.sep)
    return pjoin(os.sep.join([os.pardir for i in range(n+1)]), cmd.build_lib)
Пример #6
0
 def add_config_header():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     target = join(scons_build_dir, local_dir, 'config.h')
     incl_dir = os.path.dirname(target)
     if incl_dir not in config.numpy_include_dirs:
         config.numpy_include_dirs.append(incl_dir)
Пример #7
0
 def add_config_header():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     target = join(get_scons_pkg_build_dir(config.name), 'config.h')
     incl_dir = os.path.dirname(target)
     if incl_dir not in config.numpy_include_dirs:
         config.numpy_include_dirs.append(incl_dir)
Пример #8
0
 def add_ufunc_api():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     h_file = join(scons_build_dir, local_dir, '__ufunc_api.h')
     t_file = join(scons_build_dir, local_dir, 'ufunc_api.txt')
     config.add_data_files((header_dir, h_file),
                           (header_dir, t_file))
Пример #9
0
def _get_top_dir(pkg):
    # XXX: this mess is necessary because scons is launched per package, and
    # has no knowledge outside its build dir, which is package dependent. If
    # one day numscons does not launch one process/package, this will be
    # unnecessary.
    from numscons import get_scons_build_dir
    from numscons.core.utils import pkg_to_path
    scdir = pjoin(get_scons_build_dir(), pkg_to_path(pkg))
    n = scdir.count(os.sep)
    return os.sep.join([os.pardir for i in range(n+1)])
Пример #10
0
def _get_top_dir(pkg):
    # XXX: this mess is necessary because scons is launched per package, and
    # has no knowledge outside its build dir, which is package dependent. If
    # one day numscons does not launch one process/package, this will be
    # unnecessary.
    from numscons import get_scons_build_dir
    from numscons.core.utils import pkg_to_path
    scdir = pjoin(get_scons_build_dir(), pkg_to_path(pkg))
    n = scdir.count(os.sep)
    return os.sep.join([os.pardir for i in range(n + 1)])
Пример #11
0
 def add_array_api():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     h_file = join(get_scons_pkg_build_dir(config.name),
                   'include/numpy/__multiarray_api.h')
     t_file = join(get_scons_pkg_build_dir(config.name),
                   'include/numpy/multiarray_api.txt')
     config.add_data_files((header_dir, h_file), (header_dir, t_file))
Пример #12
0
 def add_array_api():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     h_file = join(get_scons_pkg_build_dir(config.name),
             'include/numpy/__multiarray_api.h')
     t_file = join(get_scons_pkg_build_dir(config.name),
             'include/numpy/multiarray_api.txt')
     config.add_data_files((header_dir, h_file),
                           (header_dir, t_file))
Пример #13
0
 def add_numpyconfig_header():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     target = join(scons_build_dir, local_dir,
                   'include/numpy/numpyconfig.h')
     incl_dir = os.path.dirname(target)
     if incl_dir not in config.numpy_include_dirs:
         config.numpy_include_dirs.append(incl_dir)
     config.add_data_files((header_dir, target))
Пример #14
0
 def add_numpyconfig_header():
     scons_build_dir = get_scons_build_dir()
     # XXX: I really have to think about how to communicate path info
     # between scons and distutils, and set the options at one single
     # location.
     target = join(get_scons_pkg_build_dir(config.name),
                   'include/numpy/numpyconfig.h')
     incl_dir = os.path.dirname(target)
     if incl_dir not in config.numpy_include_dirs:
         config.numpy_include_dirs.append(incl_dir)
     config.add_data_files((header_dir, target))
Пример #15
0
def get_numpy_include_dirs(sconscript_path):
    """Return include dirs for numpy.

    The paths are relatively to the setup.py script path."""
    from numscons import get_scons_build_dir
    scdir = pjoin(get_scons_build_dir(), pdirname(sconscript_path))
    n = scdir.count(os.sep)

    dirs = _incdir()
    rdirs = []
    for d in dirs:
        rdirs.append(pjoin(os.sep.join([os.pardir for i in range(n + 1)]), d))
    return rdirs
Пример #16
0
def get_numpy_include_dirs(sconscript_path):
    """Return include dirs for numpy.

    The paths are relatively to the setup.py script path."""
    from numscons import get_scons_build_dir
    scdir = pjoin(get_scons_build_dir(), pdirname(sconscript_path))
    n = scdir.count(os.sep)

    dirs = _incdir()
    rdirs = []
    for d in dirs:
        rdirs.append(pjoin(os.sep.join([os.pardir for i in range(n+1)]), d))
    return rdirs
Пример #17
0
 def add_ufunc_api():
     scons_build_dir = get_scons_build_dir()
Пример #18
0
def get_scons_build_dir():
    """Return the top path where everything produced by scons will be put.

    The path is relative to the top setup.py"""
    from numscons import get_scons_build_dir
    return get_scons_build_dir()
Пример #19
0
def get_scons_pkg_build_dir(pkg):
    """Return the build directory for the given package (foo.bar).

    The path is relative to the top setup.py"""
    from numscons.core.utils import pkg_to_path
    return pjoin(get_scons_build_dir(), pkg_to_path(pkg))
Пример #20
0
 def add_ufunc_api():
     scons_build_dir = get_scons_build_dir()