Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ypkg2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

from timeit import default_timer as timer
from datetime import timedelta
from concurrent.futures import ThreadPoolExecutor


def show_version():
Expand Down Expand Up @@ -496,15 +497,22 @@ def build_package(filename, outputDir, buildDir=None):

gene.emit_packages()
# TODO: Ensure main is always first
package_tasks = []
for package in sorted(gene.packages):
pkg = gene.packages[package]
files = sorted(pkg.emit_files())
if len(files) == 0:
console_ui.emit_info("Package", "Skipping empty package: {}".
format(package))
continue
package_tasks.append(pkg)

def executor_create_eopkg(pkg):
metadata.create_eopkg(ctx, gene, pkg, outputDir)

with ThreadPoolExecutor() as executor:
executor.map(executor_create_eopkg, package_tasks)

# Write out the final pspec
metadata.write_spec(ctx, gene, outputDir)

Expand Down
5 changes: 0 additions & 5 deletions ypkg2/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,6 @@ def create_eopkg(context, gene, package, outputDir):
""" Do the hard work and write the package out """
global history_timestamp

start_time = timer()

name = construct_package_name(context, package)
fpath = os.path.join(outputDir, name)

Expand Down Expand Up @@ -463,9 +461,6 @@ def create_eopkg(context, gene, package, outputDir):
format(e))
sys.exit(1)

end_time = timer()
console_ui.emit_info("Package", "{} took {} to emit".format(name, timedelta(seconds=end_time-start_time)))


def write_spec(context, gene, outputDir):
""" Write out a compatibility pspec_$ARCH.xml """
Expand Down