Example #1
0
def build(c, output='build', ziparchive=None):
    if os.path.exists(output):
        print('--> Removing {} directory'.format(output))
        rmtree(output)

    # Firstly dependencies needs to be "flatten" with pip-compile as pip requires --no-deps if --platform is used
    print('--> Flattening dependencies to temporary requirements file')
    with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
        c.run(f'pip-compile requirements/app.txt --output-file=-',
              out_stream=tmp)

    # Then install all stuff with pip to output folder
    print('--> Installing with pip for specific version')
    args = [
        'pip', 'install', '-r', tmp.name, '--python-version', '37',
        '--platform', PIP_PLATFORM, '--target "{}"'.format(output),
        '--no-compile', '--no-deps'
    ]
    c.run(" ".join(args), echo=True)
    os.unlink(tmp.name)

    print('--> Copying source files')
    copy_tree("src", output)

    if ziparchive is not None:
        print('--> Compressing to {}'.format(ziparchive))
        zip_folder_to_file(output, ziparchive)
def build(c, output="output", ziparchive=None):
    buildtools.build(src='src', output=output)

    version = buildtools.load_version(repo_path)
    update_changelog(c, out_dir=output)

    # create manifest
    manifest = {
        "name": "Galaxy Paradox plugin",
        "platform": "paradox",
        "guid": "bfa5a6c9-r0c3-5g28-b921-f4cd75d4999a",
        "version": version,
        "description": "Galaxy Paradox plugin",
        "author": "Friends of Galaxy",
        "email": "*****@*****.**",
        "url": "https://github.com/FriendsOfGalaxy/galaxy-integration-paradox",
        "update_url":
        "https://raw.githubusercontent.com/FriendsOfGalaxy/galaxy-integration-paradox/master/current_version.json",
        "script": "plugin.py"
    }

    with open(os.path.join(output, "manifest.json"), "w") as f:
        json.dump(manifest, f, indent=4)

    if ziparchive is not None:
        zip_folder_to_file(output, ziparchive)
Example #3
0
def pack(ctx, output_dir=_OUTPUT_DIR):
    from galaxy.tools import zip_folder_to_file

    build(ctx, output_dir=output_dir)
    zip_folder_to_file(
        output_dir,
        f"{_MANIFEST.platform}_{_MANIFEST.guid}_v{_MANIFEST.version}_{_PLATFORM}.zip"
    )
Example #4
0
def dist(c, archive_name=f'amazon_{PLUGIN_GUID}.zip'):
    print(
        f'[{colored("TASK", "yellow")}] Creating zipped file for distribution ...'
    )
    if Path(archive_name).resolve().exists():
        Path(archive_name).resolve().unlink()

    update_changelog(c)

    zip_folder_to_file(str(DIST_PATH), archive_name)
def archive(c, zip_name=None, target=None):
    if target is None:
        build(c, 'build')
        target = 'build'
    if zip_name is None:
        zip_name = f'humblebundle_{__version__}.zip'
    print(f'Zipping build from `{target}` to `{zip_name}`')

    zip_folder_to_file(target, zip_name)
    zip_path = Path('.') / zip_name
    return str(zip_path.resolve())
Example #6
0
def build(c, output="build", ziparchive=None):
    if os.path.exists(output):
        print_task(f"Removing {output} directory")
        rmtree(output)

    # Firstly dependencies needs to be "flatten" with pip-compile
    # as pip requires --no-deps if --platform is used
    print_task("Flattening dependencies to temporary requirements file from Pipfile")
    with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
        c.run("pipenv lock -r", out_stream=tmp)

    # Then install all stuff with pip to output folder
    print_task("Installing with pip for specific version")
    args = [
        "pip",
        "install",
        "-r",
        tmp.name,
        "--python-version",
        "37",
        "--platform",
        PIP_PLATFORM,
        '--target "{}"'.format(output),
        "--no-compile",
        "--no-deps",
        "--implementation",
        "cp",
    ]
    c.run(" ".join(args), echo=True)
    os.unlink(tmp.name)

    print_task(f"Copying source files to {output}")
    copy_tree("src", output)

    if ziparchive is not None:
        print_task(f"Compressing to {ziparchive}")
        zip_folder_to_file(output, ziparchive)