本文整理汇总了Python中pybuilder.core.Project.build_depends_on_requirements方法的典型用法代码示例。如果您正苦于以下问题:Python Project.build_depends_on_requirements方法的具体用法?Python Project.build_depends_on_requirements怎么用?Python Project.build_depends_on_requirements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pybuilder.core.Project
的用法示例。
在下文中一共展示了Project.build_depends_on_requirements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InstallBuildDependenciesTest
# 需要导入模块: from pybuilder.core import Project [as 别名]
# 或者: from pybuilder.core.Project import build_depends_on_requirements [as 别名]
class InstallBuildDependenciesTest(unittest.TestCase):
def setUp(self):
self.project = Project("unittest", ".")
self.project.set_property("dir_install_logs", "any_directory")
self.logger = mock(Logger)
initialize_install_dependencies_plugin(self.project)
when(pybuilder.plugins.python.install_dependencies_plugin).execute_command(any_value(),
any_value(),
env=any_value(),
shell=False).thenReturn(0)
def tearDown(self):
unstub()
def test_should_install_multiple_dependencies(self):
self.project.build_depends_on("spam")
self.project.build_depends_on("eggs")
self.project.build_depends_on_requirements("requirements-dev.txt")
install_build_dependencies(self.logger, self.project)
verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
PIP_EXEC_STANZA + ["install", "spam"], any_value(), shell=False)
verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
PIP_EXEC_STANZA + ["install", "eggs"], any_value(), shell=False)
verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
PIP_EXEC_STANZA + ["install", '-r', 'requirements-dev.txt'], any_value(), shell=False)
示例2: InstallBuildDependenciesTest
# 需要导入模块: from pybuilder.core import Project [as 别名]
# 或者: from pybuilder.core.Project import build_depends_on_requirements [as 别名]
class InstallBuildDependenciesTest(unittest.TestCase):
def setUp(self):
self.project = Project("unittest", ".")
self.project.set_property("dir_install_logs", "any_directory")
self.logger = mock(Logger)
when(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
any_value(), any_value(), shell=True
).thenReturn(0)
def tearDown(self):
unstub()
def test_should_install_multiple_dependencies(self):
self.project.build_depends_on("spam")
self.project.build_depends_on("eggs")
self.project.build_depends_on_requirements("requirements-dev.txt")
install_build_dependencies(self.logger, self.project)
verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
"pip install 'spam'", any_value(), shell=True
)
verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
"pip install 'eggs'", any_value(), shell=True
)
verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
"pip install '-rrequirements-dev.txt'", any_value(), shell=True
)
示例3: InstallBuildDependenciesTest
# 需要导入模块: from pybuilder.core import Project [as 别名]
# 或者: from pybuilder.core.Project import build_depends_on_requirements [as 别名]
class InstallBuildDependenciesTest(unittest.TestCase):
def setUp(self):
self.project = Project("unittest", ".")
self.project.set_property("dir_install_logs", "any_directory")
self.logger = Mock(Logger)
initialize_install_dependencies_plugin(self.project)
@patch("pybuilder.plugins.python.install_dependencies_plugin.execute_command", return_value=0)
def test_should_install_multiple_dependencies(self, exec_command, get_package_version):
self.project.build_depends_on("spam")
self.project.build_depends_on("eggs")
self.project.build_depends_on_requirements("requirements-dev.txt")
install_build_dependencies(self.logger, self.project)
exec_command(PIP_EXEC_STANZA + ["install", "spam"], ANY, shell=False)
exec_command(PIP_EXEC_STANZA + ["install", "eggs"], ANY, shell=False)
exec_command(PIP_EXEC_STANZA + ["install", '-r', 'requirements-dev.txt'], ANY, shell=False)