本文整理汇总了Python中pybuilder.utils.assert_can_execute函数的典型用法代码示例。如果您正苦于以下问题:Python assert_can_execute函数的具体用法?Python assert_can_execute怎么用?Python assert_can_execute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assert_can_execute函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: assert_frosted_is_executable
def assert_frosted_is_executable(logger):
""" Asserts that the frosted script is executable. """
logger.debug("Checking if frosted is executable.")
assert_can_execute(
command_and_arguments=["frosted", "--version"], prerequisite="frosted (PyPI)", caller="plugin python.frosted"
)
示例2: assert_cram_is_executable
def assert_cram_is_executable(logger):
""" Asserts that the cram script is executable. """
logger.debug("Checking if cram is executable.")
assert_can_execute(command_and_arguments=["cram", "--version"],
prerequisite="cram",
caller="plugin python.cram")
示例3: assert_py2dsc_deb_is_available
def assert_py2dsc_deb_is_available(logger):
"""Asserts that the py2dsc-deb is available.
"""
logger.debug("Checking if py2dsc-deb is available.")
assert_can_execute(
["py2dsc-deb", "-h"], "py2dsc-deb", "plugin python.stdeb")
示例4: set_description
def set_description(project, logger):
if project.get_property("distutils_readme_description"):
try:
assert_can_execute(["pandoc", "--version"], "pandoc", "distutils")
doc_convert(project, logger)
except (MissingPrerequisiteException, ImportError):
logger.warn("Was unable to find pandoc or pypandoc and did not convert the documentation")
示例5: assert_sphinx_quickstart_is_available
def assert_sphinx_quickstart_is_available(logger):
"""Asserts that the sphinx-quickstart script is available.
"""
logger.debug("Checking if sphinx-quickstart is available.")
assert_can_execute(
["sphinx-quickstart", "--version"], "sphinx", "plugin python.sphinx")
示例6: assert_flake8_is_executable
def assert_flake8_is_executable(logger):
""" Asserts that the flake8 script is executable. """
logger.debug("Checking if flake8 is executable.")
assert_can_execute(command_and_arguments=["flake8", "--version"],
prerequisite="flake8",
caller="plugin python.flake8")
示例7: assert_dpkg_is_available
def assert_dpkg_is_available(logger):
"""Asserts that the dpkg-buildpackage is available.
"""
logger.debug("Checking if dpkg-buildpackage is available")
assert_can_execute(
["dpkg-buildpackage", "--help"], "dpkg-buildpackage", "plugin python.stdeb")
示例8: assert_sphinx_is_available
def assert_sphinx_is_available(logger):
"""Asserts that the sphinx-build script is available.
"""
logger.debug("Checking if sphinx-build and sphinx-apidoc are available.")
assert_can_execute(
["sphinx-build", "--version"], "sphinx", "plugin python.sphinx")
assert_can_execute(
["sphinx-apidoc", "--version"], "sphinx", "plugin python.sphinx")
示例9: assert_gzip_is_executable
def assert_gzip_is_executable(logger):
"""
Asserts that the gzip program is executable.
"""
logger.debug("Checking if gzip is executable.")
assert_can_execute(command_and_arguments=["gzip", "--version"],
prerequisite="gzip",
caller="plugin ronn_manpage_plugin")
示例10: assert_ronn_is_executable
def assert_ronn_is_executable(logger):
"""
Asserts that the ronn script is executable.
"""
logger.debug("Checking if ronn is executable.")
assert_can_execute(command_and_arguments=["ronn", "--version"],
prerequisite="ronn",
caller="plugin ronn_manpage_plugin")
示例11: upload_distribution
def upload_distribution(project, logger) :
project.build_depends_on("devpi")
assert_can_execute(["devpi", "--version"], prerequisite="devpi PyPi Server", caller="devpi_plugin")
index_name = "{}/{}".format(project.get_property("devpi_user"), project.get_property("devpi_staging_index"))
logger.info("Uploading binary distribution in %s to staging index %s", project.expand_path("$dir_dist"), index_name)
run_devpi_command(project, logger, ["login", project.get_property("devpi_user"), "--password="])
run_devpi_command(project, logger, ["use", project.get_property("devpi_staging_index")])
run_devpi_command(project, logger, ["upload", "--no-vcs", "--formats=bdist_wheel,bdist_egg"])
示例12: pdoc_prepare
def pdoc_prepare(project, logger):
""" Asserts that pdoc is executable. """
logger.debug("Checking if pdoc is executable.")
assert_can_execute(command_and_arguments=["pdoc", "--version"],
prerequisite="pdoc",
caller="plugin python.pdoc")
pdoc_output_dir = project.expand_path("$pdoc_output_dir")
if not os.path.exists(pdoc_output_dir):
os.mkdir(pdoc_output_dir)
示例13: generate_manpage_with_pandoc
def generate_manpage_with_pandoc(project, logger):
import os
import shutil
import subprocess
assert_can_execute(['pandoc', '-v'], 'pandoc', 'generate_manpage_with_pandoc')
subprocess.check_output('pandoc -s -t man man-yadtminion.md -o docs/man/yadtminion.1.man', shell=True)
subprocess.check_output('rm -f docs/man/yadtminion.1.man.gz && gzip -9 docs/man/yadtminion.1.man', shell=True)
for script in os.listdir('src/main/scripts'):
script_manpage = '%s.1.man.gz' % script
shutil.copyfile('docs/man/yadtminion.1.man.gz', 'docs/man/%s' % script_manpage)
示例14: push_distribution
def push_distribution(project, logger) :
project.build_depends_on("devpi")
assert_can_execute(["devpi", "--version"], prerequisite="devpi PyPi Server", caller="devpi_plugin")
distribution_name = "{}-{}".format(project.name, project.version)
index_name = "{}/{}".format(project.get_property("devpi_user"), project.get_property("devpi_release_index"))
logger.info("Pushing binary distribution %s to release index %s", distribution_name, index_name)
run_devpi_command(project, logger, ["login", project.get_property("devpi_user"), "--password="])
run_devpi_command(project, logger, ["use", project.get_property("devpi_release_index")])
run_devpi_command(project, logger, ["push", distribution_name, index_name])
示例15: pdoc_generate
def pdoc_generate(project, logger):
assert_can_execute(command_and_arguments=["pdoc", "--version"],
prerequisite="pdoc",
caller=pdoc_generate.__name__)
logger.info("Generating pdoc documentation")
command_and_arguments = ["pdoc", "--html", "pybuilder", "--all-submodules", "--overwrite", "--html-dir", "api-doc"]
source_directory = project.get_property("dir_source_main_python")
environment = {"PYTHONPATH": source_directory,
"PATH": os.environ["PATH"]}
subprocess.check_call(command_and_arguments, shell=False, env=environment)