本文整理汇总了Python中egginst.main.EggInst.install方法的典型用法代码示例。如果您正苦于以下问题:Python EggInst.install方法的具体用法?Python EggInst.install怎么用?Python EggInst.install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类egginst.main.EggInst
的用法示例。
在下文中一共展示了EggInst.install方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_custom_egg_with_usr_files_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_custom_egg_with_usr_files_remove(self):
egg = NOSE_1_3_0
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()
示例2: test_custom_egg_legacy_egg_info_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_custom_egg_legacy_egg_info_remove(self):
egg = LEGACY_EGG_INFO_EGG
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()
示例3: test_custom_egg_with_usr_files
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_custom_egg_with_usr_files(self):
custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "nose")
egg_info_base = os.path.join(self.site_packages,
"nose-{0}.egg-info".
format("1.3.0-1"))
egg = NOSE_1_3_0
egginst = EggInst(egg, self.base_dir)
egginst.install()
# Check for files installed in $prefix/EGG-INFO
for f in DUMMY_EGG_METADATA_FILES:
path = os.path.join(custom_egg_info_base, f)
self.assertTrue(os.path.exists(path))
# Check for files installed in $site-packages/$package_egg_info-INFO
path = os.path.join(egg_info_base, "PKG-INFO")
self.assertTrue(os.path.exists(path))
path = os.path.join(egg_info_base, "spec/depend")
self.assertFalse(os.path.exists(path))
path = os.path.join(egg_info_base, "spec/summary")
self.assertFalse(os.path.exists(path))
path = os.path.join(egg_info_base, "usr/share/man/man1/nosetests.1")
self.assertFalse(os.path.exists(path))
示例4: test_symlink
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_symlink(self):
"""Test installing an egg with softlink in it."""
# Given
if sys.platform == "win32":
incdir = os.path.join(self.prefix, "EGG-INFO", "foo", "usr",
"include")
header = os.path.join(incdir, "foo.h")
link = os.path.join(self.prefix, "EGG-INFO", "foo", "usr",
"HEADERS")
else:
incdir = os.path.join(self.prefix, "include")
header = os.path.join(incdir, "foo.h")
link = os.path.join(self.prefix, "HEADERS")
egg_filename = os.path.join(self.base_dir, "foo-1.0.egg")
_create_egg_with_symlink(egg_filename, "foo")
# When
installer = EggInst(egg_filename, prefix=self.prefix)
installer.install()
# Then
self.assertTrue(os.path.exists(header))
self.assertTrue(os.path.exists(link))
self.assertTrue(os.path.islink(link))
self.assertEqual(os.readlink(link), "include")
self.assertTrue(os.path.exists(os.path.join(link, "foo.h")))
示例5: test_simple_custom_egg_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_simple_custom_egg_remove(self):
egg = DUMMY_EGG
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()
示例6: test_softlink_with_broken_entry
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_softlink_with_broken_entry(self):
# Given
path = VTK_EGG_DEFERRED_SOFTLINK
# When
installer = EggInst(path, prefix=self.prefix)
installer.install()
示例7: test_custom_egg_legacy_egg_info
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_custom_egg_legacy_egg_info(self):
custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "flake8")
egg_info_base = os.path.join(self.site_packages,
"flake8-2.0.0-2.egg-info")
legacy_egg_info_base = os.path.join(self.site_packages, "flake8.egg-info")
custom_metadata = ("PKG-INFO.bak", "requires.txt", "spec/depend",
"spec/summary")
egg = LEGACY_EGG_INFO_EGG
egginst = EggInst(egg, self.base_dir)
egginst.install()
# Check for files installed in $prefix/EGG-INFO
for f in custom_metadata:
path = os.path.join(custom_egg_info_base, f)
self.assertTrue(os.path.exists(path))
# Check for files installed in $site-packages/$package_egg_info-INFO
for f in LEGACY_EGG_INFO_EGG_METADATA_FILES:
path = os.path.join(egg_info_base, f)
self.assertTrue(os.path.exists(path))
for f in LEGACY_EGG_INFO_EGG_METADATA_FILES:
path = os.path.join(legacy_egg_info_base, f)
self.assertFalse(os.path.exists(path))
示例8: test_old_appinst
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_old_appinst(self):
"""
Test that we still work with old (<= 2.1.1) appinst, where
[un]install_from_dat only takes one argument (no prefix).
"""
egg_path = DUMMY_EGG_WITH_APPINST
appinst_path = os.path.join(self.meta_dir, "dummy_with_appinst", eggmeta.APPINST_PATH)
egginst = EggInst(egg_path, self.base_dir)
def mocked_old_install_from_dat(x):
pass
def mocked_old_uninstall_from_dat(x):
pass
# XXX: we use autospec to enforce function taking exactly one argument,
# otherwise the proper TypeError exception is not raised when calling
# it with two arguments, which is how old vs new appinst is detected.
with mock.patch("appinst.install_from_dat", autospec=mocked_old_install_from_dat) as m:
egginst.install()
m.assert_called_with(appinst_path)
with mock.patch("appinst.uninstall_from_dat", autospec=mocked_old_uninstall_from_dat) as m:
egginst.remove()
m.assert_called_with(appinst_path)
示例9: _install_egg_empty_egg_info_dir
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def _install_egg_empty_egg_info_dir(self, egg_path):
installer = EggInst(egg_path, prefix=self.prefix)
installer.install()
egg_info_dir = os.path.join(installer.site_packages,
setuptools_egg_info_dir(egg_path))
shutil.rmtree(egg_info_dir)
os.makedirs(egg_info_dir)
示例10: test_simple
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_simple(self):
egginst = EggInst(DUMMY_EGG, self.base_dir)
egginst.install()
self.assertTrue(os.path.exists(os.path.join(self.site_packages, "dummy.py")))
egginst.remove()
self.assertFalse(os.path.exists(os.path.join(self.site_packages, "dummy.py")))
示例11: test_standard_egg_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_standard_egg_remove(self):
egg = STANDARD_EGG
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()
示例12: _install_egg_file_egg_info_dir
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def _install_egg_file_egg_info_dir(self, egg_path):
installer = EggInst(egg_path, prefix=self.prefix)
installer.install()
egg_info_dir = os.path.join(installer.site_packages,
setuptools_egg_info_dir(egg_path))
shutil.rmtree(egg_info_dir)
with open(egg_info_dir, "w") as fp:
fp.write("")
示例13: test_custom_egg_with_usr_files_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_custom_egg_with_usr_files_remove(self):
custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "nose")
egg_info_base = os.path.join(self.site_packages,
"nose-{0}.egg-info". \
format("1.3.0-1"))
egg = NOSE_1_3_0
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()
示例14: test_standard_egg_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_standard_egg_remove(self):
custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "jinja2")
egg_info_base = os.path.join(self.site_packages,
"Jinja2-2.6-py2.7.egg-info")
egg = STANDARD_EGG
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()
示例15: test_custom_egg_legacy_egg_info_remove
# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import install [as 别名]
def test_custom_egg_legacy_egg_info_remove(self):
custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "flake9")
egg_info_base = os.path.join(self.site_packages,
"flake8-2.0.0-2.egg-info")
legacy_egg_info_base = os.path.join(self.site_packages, "flake8.egg-info")
egg = LEGACY_EGG_INFO_EGG
with assert_same_fs(self, self.base_dir):
egginst = EggInst(egg, self.base_dir)
egginst.install()
egginst.remove()