Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return_code = execute_command(
command_and_arguments, report_file_name, env, error_file_name=error_file_name)
test_time.stop()
report_item = {
"test": name,
"test_file": test,
"time": test_time.get_millis(),
"success": True
}
if return_code != 0:
logger.error("Integration test failed: %s", test)
report_item["success"] = False
if project.get_property("verbose") or project.get_property("integrationtest_always_verbose"):
print_file_content(report_file_name)
print_text_line()
print_file_content(error_file_name)
report_item['exception'] = ''.join(read_file(error_file_name)).replace('\'', '')
elif project.get_property("integrationtest_always_verbose"):
print_file_content(report_file_name)
print_text_line()
print_file_content(error_file_name)
return report_item
shutil.move(src_file, script_dir)
setup_args = sys.argv[1:]
subprocess.check_call([sys.executable, "setup.py"] + setup_args, cwd=script_dir)
except subprocess.CalledProcessError as e:
exit_code = e.returncode
sys.exit(exit_code)
'''
if os.path.exists("setup.py"):
choice = prompt_user("Overwrite 'setup.py' (y/N)?", 'n')
overwrite = not choice or choice.lower() == 'y'
if not overwrite:
return
os.unlink("setup.py")
with open('setup.py', 'w') as setup_descriptor_file:
setup_descriptor_file.write(setup_py_file_contents)
print_text_line("\nCreated 'setup.py'.")
def print_build_summary(options, summary):
print_text_line("Build Summary")
print_text_line("%20s: %s" % ("Project", summary.project.name))
print_text_line("%20s: %s%s" % ("Version", summary.project.version, get_dist_version_string(summary.project)))
print_text_line("%20s: %s" % ("Base directory", summary.project.basedir))
print_text_line("%20s: %s" %
("Environments", ", ".join(options.environments)))
task_summary = ""
for task in summary.task_summaries:
task_summary += " %s [%d ms]" % (task.task, task.execution_time)
print_text_line("%20s:%s" % ("Tasks", task_summary))
def print_task_list(tasks, quiet=False):
if quiet:
print_text_line("\n".join([task.name + ":" + task_description(task)
for task in tasks]))
return
column_length = length_of_longest_string(
list(map(lambda task: task.name, tasks)))
column_length += 4
for task in tasks:
task_name = task.name.rjust(column_length)
print_text_line("{0} - {1}".format(task_name, task_description(task)))
if task.dependencies:
whitespace = (column_length + 3) * " "
depends_on_message = "depends on tasks: %s" % " ".join(
[str(dependency) for dependency in task.dependencies])
print_text_line(whitespace + depends_on_message)
for task in tasks]))
return
column_length = length_of_longest_string(
list(map(lambda task: task.name, tasks)))
column_length += 4
for task in tasks:
task_name = task.name.rjust(column_length)
print_text_line("{0} - {1}".format(task_name, task_description(task)))
if task.dependencies:
whitespace = (column_length + 3) * " "
depends_on_message = "depends on tasks: %s" % " ".join(
[str(dependency) for dependency in task.dependencies])
print_text_line(whitespace + depends_on_message)
def print_build_summary(options, summary):
print_text_line("Build Summary")
print_text_line("%20s: %s" % ("Project", summary.project.name))
print_text_line("%20s: %s%s" % ("Version", summary.project.version, get_dist_version_string(summary.project)))
print_text_line("%20s: %s" % ("Base directory", summary.project.basedir))
print_text_line("%20s: %s" %
("Environments", ", ".join(options.environments)))
task_summary = ""
for task in summary.task_summaries:
task_summary += " %s [%d ms]" % (task.task, task.execution_time)
print_text_line("%20s:%s" % ("Tasks", task_summary))
def print_task_list(tasks, quiet=False):
if quiet:
print_text_line("\n".join([task.name + ":" + task_description(task)
for task in tasks]))
return
column_length = length_of_longest_string(
list(map(lambda task: task.name, tasks)))
column_length += 4
for task in tasks:
task_name = task.name.rjust(column_length)
print_text_line("{0} - {1}".format(task_name, task_description(task)))
if task.dependencies:
whitespace = (column_length + 3) * " "
depends_on_message = "depends on tasks: %s" % " ".join(
[str(dependency) for dependency in task.dependencies])
print_text_line(whitespace + depends_on_message)
def start_project():
try:
scaffolding = collect_project_information()
except KeyboardInterrupt:
print_text_line('\nCanceled.')
return 1
descriptor = scaffolding.render_build_descriptor()
with open('build.py', 'w') as build_descriptor_file:
build_descriptor_file.write(descriptor)
scaffolding.set_up_project()
_create_setup_file()
return 0