Пример #1
0
def update(meta, source_path):
    path = Path(meta)

    click.echo('Updating {} recipe...'.format(path.parent))

    content = render(path)
    recipe = ruamel.yaml.round_trip_load(content)

    # update the necessary fields, skip leading 'v' in the version
    recipe['package']['version'] = ibis.__version__[1:]
    recipe['source'] = {'path': source_path}

    # XXX: because render will remove the {{ PYTHON }} variable
    recipe['build']['script'] = SCRIPT

    updated_content = ruamel.yaml.round_trip_dump(recipe,
                                                  default_flow_style=False,
                                                  width=sys.maxsize).strip()

    if PY2:
        updated_content = updated_content.decode('utf-8')

    click.echo(updated_content)

    path.write_text(updated_content)
Пример #2
0
def update(meta, source_path):
    path = Path(meta)

    click.echo('\nUpdating {} recipe...'.format(path.parent))

    content = render(path)
    recipe = ruamel.yaml.round_trip_load(content)

    # update the necessary fields, skip leading 'v' in the version
    recipe['package']['version'] = ibis.__version__[1:]
    recipe['source'] = {'path': source_path}

    updated_content = ruamel.yaml.round_trip_dump(recipe,
                                                  default_flow_style=False)

    if PY2:
        updated_content = updated_content.decode('utf-8')

    path.write_text(updated_content)