예제 #1
0
def get_distutils_install_prefix(pkg, inplace):
    """Returns the installation path for the current package."""
    from numscons.core.utils import pkg_to_path
    if inplace == 1:
        return pkg_to_path(pkg)
    else:
        install_cmd = get_cmd('install').get_finalized_command('install')
        return pjoin(install_cmd.install_libbase, pkg_to_path(pkg))
예제 #2
0
파일: scons.py 프로젝트: Kurios/Project32
def get_distutils_install_prefix(pkg, inplace):
    """Returns the installation path for the current package."""
    from numscons.core.utils import pkg_to_path
    if inplace == 1:
        return pkg_to_path(pkg)
    else:
        install_cmd = get_cmd('install').get_finalized_command('install')
        return pjoin(install_cmd.install_libbase, pkg_to_path(pkg))
예제 #3
0
파일: scons.py 프로젝트: illume/numpy3k
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 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)
예제 #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
파일: scons.py 프로젝트: Kurios/Project32
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)])
예제 #7
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)])
예제 #8
0
    def __init__(self, *args, **kw):
        if kw.has_key('tools'):
            raise NumsconsError("NumpyEnvironment has received a tools "\
                                "argument.")
        else:
            kw['tools'] = []

        Environment.__init__(self, *args, **kw)

        # Setting dirs according to command line options
        self['build_dir'] = pjoin(self['build_prefix'], pkg_to_path(self['pkg_name']))

        # Set directory where to "install" built C extensions
        if self["inplace"]:
            self['distutils_installdir'] = pjoin(str(self.fs.Top), self["pkg_path"])
        else:
            if not self.has_key('distutils_installdir'):
                # XXX: compatibility with upstream numpy trunk - this can be
                # removed once install_clib is merged
                self["distutils_installdir"] = ''
            self['distutils_installdir'] = pjoin(self['distutils_libdir'], pkg_to_path(self['pkg_name']))

        if not self.has_key('distutils_install_prefix'):
            # XXX: compatibility with upstream numpy trunk - this can be
            # removed once install_clib is merged
            self["distutils_install_prefix"] = ''
        else:
            self["distutils_install_prefix"] = os.path.abspath(pjoin(str(self.fs.Top), self["distutils_install_prefix"]))

        # This will keep our compiler dependent customization (optimization,
        # warning, etc...)
        self['NUMPY_CUSTOMIZATION'] = {}

        self._set_sconsign_location()
        self._customize_scons_env()
        set_logging(self)
예제 #9
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))
예제 #10
0
 def test1(self):
     assert pkg_to_path(self.pkg1) == self.path1_expected
     assert pkg_to_path(self.pkg2) == self.path2_expected
예제 #11
0
 def test1(self):
     assert pkg_to_path(self.pkg1) == self.path1_expected
     assert pkg_to_path(self.pkg2) == self.path2_expected