当前位置: 首页>>代码示例>>Python>>正文


Python build_ext.USER_BASE属性代码示例

本文整理汇总了Python中distutils.command.build_ext.build_ext.USER_BASE属性的典型用法代码示例。如果您正苦于以下问题:Python build_ext.USER_BASE属性的具体用法?Python build_ext.USER_BASE怎么用?Python build_ext.USER_BASE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在distutils.command.build_ext.build_ext的用法示例。


在下文中一共展示了build_ext.USER_BASE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_user_site

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def test_user_site(self):
        import site
        dist = Distribution({'name': 'xx'})
        cmd = build_ext(dist)

        # making sure the user option is there
        options = [name for name, short, label in
                   cmd.user_options]
        self.assertIn('user', options)

        # setting a value
        cmd.user = 1

        # setting user based lib and include
        lib = os.path.join(site.USER_BASE, 'lib')
        incl = os.path.join(site.USER_BASE, 'include')
        os.mkdir(lib)
        os.mkdir(incl)

        cmd.ensure_finalized()

        # see if include_dirs and library_dirs were set
        self.assertIn(lib, cmd.library_dirs)
        self.assertIn(lib, cmd.rpath)
        self.assertIn(incl, cmd.include_dirs) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:27,代码来源:test_build_ext.py

示例2: setUp

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def setUp(self):
        # Create a simple test environment
        # Note that we're making changes to sys.path
        super(BuildExtTestCase, self).setUp()
        self.tmp_dir = self.mkdtemp()
        self.sys_path = sys.path, sys.path[:]
        sys.path.append(self.tmp_dir)
        import site
        self.old_user_base = site.USER_BASE
        site.USER_BASE = self.mkdtemp()
        from distutils.command import build_ext
        build_ext.USER_BASE = site.USER_BASE

        # bpo-30132: On Windows, a .pdb file may be created in the current
        # working directory. Create a temporary working directory to cleanup
        # everything at the end of the test.
        self.temp_cwd = support.temp_cwd()
        self.temp_cwd.__enter__()
        self.addCleanup(self.temp_cwd.__exit__, None, None, None) 
开发者ID:CedricGuillemet,项目名称:Imogen,代码行数:21,代码来源:test_build_ext.py

示例3: setUp

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def setUp(self):
        # Create a simple test environment
        super(BuildExtTestCase, self).setUp()
        self.tmp_dir = self.mkdtemp()
        import site
        self.old_user_base = site.USER_BASE
        site.USER_BASE = self.mkdtemp()
        from distutils.command import build_ext
        build_ext.USER_BASE = site.USER_BASE

        # bpo-30132: On Windows, a .pdb file may be created in the current
        # working directory. Create a temporary working directory to cleanup
        # everything at the end of the test.
        change_cwd = support.change_cwd(self.tmp_dir)
        change_cwd.__enter__()
        self.addCleanup(change_cwd.__exit__, None, None, None) 
开发者ID:pypa,项目名称:setuptools,代码行数:18,代码来源:test_build_ext.py

示例4: setUp

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def setUp(self):
        super(BuildExtTestCase, self).setUp()
        self.tmp_dir = self.mkdtemp()
        self.xx_created = False
        sys.path.append(self.tmp_dir)
        self.addCleanup(sys.path.remove, self.tmp_dir)
        if sys.version > "2.6":
            import site
            self.old_user_base = site.USER_BASE
            site.USER_BASE = self.mkdtemp()
            from distutils.command import build_ext
            build_ext.USER_BASE = site.USER_BASE 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:14,代码来源:test_build_ext.py

示例5: setUp

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def setUp(self):
        # Create a simple test environment
        # Note that we're making changes to sys.path
        super(BuildExtTestCase, self).setUp()
        self.tmp_dir = self.mkdtemp()
        self.sys_path = sys.path, sys.path[:]
        sys.path.append(self.tmp_dir)
        import site
        self.old_user_base = site.USER_BASE
        site.USER_BASE = self.mkdtemp()
        from distutils.command import build_ext
        build_ext.USER_BASE = site.USER_BASE 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:14,代码来源:test_build_ext.py

示例6: tearDown

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def tearDown(self):
        # Get everything back to normal
        support.unload('xx')
        sys.path = self.sys_path[0]
        sys.path[:] = self.sys_path[1]
        import site
        site.USER_BASE = self.old_user_base
        from distutils.command import build_ext
        build_ext.USER_BASE = self.old_user_base
        super(BuildExtTestCase, self).tearDown() 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:12,代码来源:test_build_ext.py

示例7: test_user_site

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def test_user_site(self):
        import site
        dist = Distribution({'name': 'xx'})
        cmd = self.build_ext(dist)

        # making sure the user option is there
        options = [name for name, short, lable in
                   cmd.user_options]
        self.assertIn('user', options)

        # setting a value
        cmd.user = 1

        # setting user based lib and include
        lib = os.path.join(site.USER_BASE, 'lib')
        incl = os.path.join(site.USER_BASE, 'include')
        os.mkdir(lib)
        os.mkdir(incl)

        # let's run finalize
        cmd.ensure_finalized()

        # see if include_dirs and library_dirs
        # were set
        self.assertIn(lib, cmd.library_dirs)
        self.assertIn(lib, cmd.rpath)
        self.assertIn(incl, cmd.include_dirs) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:29,代码来源:test_build_ext.py

示例8: test_user_site

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def test_user_site(self):
        import site
        dist = Distribution({'name': 'xx'})
        cmd = build_ext(dist)

        # making sure the user option is there
        options = [name for name, short, lable in
                   cmd.user_options]
        self.assertIn('user', options)

        # setting a value
        cmd.user = 1

        # setting user based lib and include
        lib = os.path.join(site.USER_BASE, 'lib')
        incl = os.path.join(site.USER_BASE, 'include')
        os.mkdir(lib)
        os.mkdir(incl)

        # let's run finalize
        cmd.ensure_finalized()

        # see if include_dirs and library_dirs
        # were set
        self.assertIn(lib, cmd.library_dirs)
        self.assertIn(lib, cmd.rpath)
        self.assertIn(incl, cmd.include_dirs) 
开发者ID:IronLanguages,项目名称:ironpython3,代码行数:29,代码来源:test_build_ext.py

示例9: tearDown

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def tearDown(self):
        import site
        site.USER_BASE = self.old_user_base
        from distutils.command import build_ext
        build_ext.USER_BASE = self.old_user_base
        super(BuildExtTestCase, self).tearDown() 
开发者ID:pypa,项目名称:setuptools,代码行数:8,代码来源:test_build_ext.py

示例10: test_user_site

# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import USER_BASE [as 别名]
def test_user_site(self):
        # site.USER_SITE was introduced in 2.6
        if sys.version < '2.6':
            return

        import site
        dist = Distribution({'name': 'xx'})
        cmd = build_ext(dist)

        # making sure the user option is there
        options = [name for name, short, label in
                   cmd.user_options]
        self.assertIn('user', options)

        # setting a value
        cmd.user = 1

        # setting user based lib and include
        lib = os.path.join(site.USER_BASE, 'lib')
        incl = os.path.join(site.USER_BASE, 'include')
        os.mkdir(lib)
        os.mkdir(incl)

        cmd.ensure_finalized()

        # see if include_dirs and library_dirs were set
        self.assertIn(lib, cmd.library_dirs)
        self.assertIn(lib, cmd.rpath)
        self.assertIn(incl, cmd.include_dirs) 
开发者ID:Acmesec,项目名称:CTFCrackTools-V2,代码行数:31,代码来源:test_build_ext.py


注:本文中的distutils.command.build_ext.build_ext.USER_BASE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。