How to use the pybuilder.core.task function in pybuilder

To help you get started, we’ve selected a few pybuilder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pybuilder / pybuilder / src / unittest / python / core_tests.py View on Github external
        @task("any-task-name")
        @description("any-description")
        def task_with_description():
            pass
github lake-lerna / hydra / build.py View on Github external
@task
@description("Run a negative test that will fail due to exception.")
def negative_test(project, logger):
    print("Running a -ve test")
    command = ExternalCommandBuilder('hydra', project)
    command.use_argument('negative-test-exception')
    result = command.run_on_production_source_files(logger)
    if result.exit_code:
        raise BuildFailedException("Exit code is set")
    return result.exit_code
github pybuilder / pybuilder / src / main / python / pybuilder / plugins / python / install_dependencies_plugin.py View on Github external
@task
@description("Installs all runtime dependencies specified in the build descriptor")
def install_runtime_dependencies(logger, project):
    logger.info("Installing runtime dependencies")
    install_dependency(logger, project, project.dependencies)
github pybuilder / pybuilder / src / main / python / pybuilder / plugins / python / distutils_plugin.py View on Github external
@task("install")
def install_distribution(project, logger):
    logger.info("Installing project %s-%s", project.name, project.version)

    _prepare_reports_dir(project)
    outfile_name = project.expand_path("$dir_reports", "distutils",
                                       "pip_install_%s" % datetime.utcnow().strftime("%Y%m%d%H%M%S"))
    pip_utils.pip_install(
        install_targets=project.expand_path("$dir_dist"),
        index_url=project.get_property("install_dependencies_index_url"),
        extra_index_url=project.get_property("install_dependencies_extra_index_url"),
        force_reinstall=True,
        logger=logger,
        verbose=project.get_property("verbose"),
        cwd=".",
        outfile_name=outfile_name,
        error_file_name=outfile_name)
github pybuilder / pybuilder / src / main / python / pybuilder / plugins / python / install_dependencies_plugin.py View on Github external
@task
@description("Installs all build dependencies specified in the build descriptor")
def install_build_dependencies(logger, project):
    logger.info("Installing build dependencies")
    install_dependency(logger, project, project.build_dependencies)
github deepmipt / kpi2017 / build.py View on Github external
@task
def train_squad(project):
    create_dir('squad')
    if project.get_property('idle_train') == 'True':
        val_time = '600'
        time_limit = '900'
    else:
        val_time = '1800'
        time_limit = '86400'
    metrics = bu.model(['-t', 'squad',
                        '-m', 'deeppavlov.agents.squad.squad:SquadAgent',
                        '--batchsize', '64',
                        '--display-examples', 'False',
                        '--num-epochs', '-1',
                        '--max-train-time', time_limit,
                        '--log-every-n-secs', '60',
                        '--log-every-n-epochs', '-1',
github pybuilder / pybuilder / src / main / python / pybuilder / plugins / exec_plugin.py View on Github external
@task
def package(project, logger):
    run_command('package', project, logger)
github pybuilder / pybuilder / src / main / python / pybuilder / plugins / exec_plugin.py View on Github external
@task
def run_unit_tests(project, logger):
    run_command('run_unit_tests', project, logger)
github pybuilder / pybuilder / src / main / python / pybuilder / plugins / python / pymetrics_plugin.py View on Github external
@task("analyze")
def execute_pymetrics(project, logger):
    logger.info("Executing pymetrics on project sources")
    source_dir = project.expand_path("$dir_source_main_python")

    files_to_scan = []
    for root, _, files in os.walk(source_dir):
        for file_name in files:
            if file_name.endswith(".py"):
                files_to_scan.append(os.path.join(root, file_name))

    csv_file = project.expand_path("$dir_reports/pymetrics.csv")

    command = ["pymetrics", "--nosql", "-c", csv_file] + files_to_scan

    report_file = project.expand_path("$dir_reports/pymetrics")