當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。