How to use apio - 10 common examples

To help you get started, we’ve selected a few apio 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 FPGAwars / apio / apio / commands / system.py View on Github external
def cli(ctx, lsftdi, lsusb, lsserial, info):
    """System tools.\n
       Install with `apio install system`"""

    exit_code = 0

    if lsftdi:
        exit_code = System().lsftdi()
    elif lsusb:
        exit_code = System().lsusb()
    elif lsserial:
        exit_code = System().lsserial()
    elif info:
        click.secho('Platform: ', nl=False)
        click.secho(get_systype(), fg='yellow')
    else:
        click.secho(ctx.get_help())

    ctx.exit(exit_code)
github FPGAwars / apio / apio / packages / system.py View on Github external
def _get_version(self):
        releases = api_request('tools-usb-ftdi/releases/latest')
        if releases is not None and 'tag_name' in releases:
            version = releases['tag_name'].split('.')[1]  # v0.X -> X
            return version
github FPGAwars / apio / apio / packages / piofpga.py View on Github external
def _get_version(self):
        releases = api_request('Platformio-FPGA/releases/latest')
        if releases is not None and 'tag_name' in releases:
            version = releases['tag_name'].split('.')[1]  # 0.X -> X
            return version
github FPGAwars / apio / apio / packages / icestorm.py View on Github external
def _get_version(self):
        releases = api_request('toolchain-icestorm/releases/latest')
        if releases is not None and 'tag_name' in releases:
            version = releases['tag_name'].split('.')[1]  # 0.X -> X
            return version
github FPGAwars / apio / apio / packages / iverilog.py View on Github external
def _get_version(self):
        releases = api_request('toolchain-iverilog/releases/latest')
        if releases is not None and 'tag_name' in releases:
            version = releases['tag_name'].split('.')[1]  # v0.X -> X
            return version
github FPGAwars / apio / apio / managers / installer.py View on Github external
def _get_valid_version(self, rel_name, organization, tag_name):

        # Download latest releases list
        releases = api_request('{}/releases'.format(rel_name), organization)

        if self.version:
            # Find required version via @
            if not util.check_package_version(self.version, self.spec_version):
                util.show_package_version_warning(
                    self.package, self.version, self.spec_version)
                exit(1)
            return self._find_required_version(
                releases, tag_name, self.version, self.spec_version)
        else:
            # Find latest version release
            return self._find_latest_version(
                releases, tag_name, self.spec_version)
github FPGAwars / apio / apio / util.py View on Github external
default.update(kwargs)
    kwargs = default

    try:
        p = subprocess.Popen(*args, **kwargs)
        result['out'], result['err'] = p.communicate()
        result['returncode'] = p.returncode
    except KeyboardInterrupt:
        click.secho('Aborted by user', fg='red')
        exit(1)
    except Exception as e:
        click.secho(str(e), fg='red')
        exit(1)
    finally:
        for s in ('stdout', 'stderr'):
            if isinstance(kwargs[s], AsyncPipe):
                kwargs[s].close()

    _parse_result(kwargs, result)

    return result
github FPGAwars / apio / apio / managers / installer.py View on Github external
def __init__(self, package, platform='', force=False, checkversion=True):

        # Parse version
        if '@' in package:
            split = package.split('@')
            self.package = split[0]
            self.version = split[1]
        else:
            self.package = package
            self.version = None

        self.force_install = force
        self.packages_dir = ''

        self.resources = Resources(platform)

        if self.package in self.resources.packages:

            self.profile = Profile()

            dirname = 'packages'
            self.packages_dir = util.safe_join(util.get_home_dir(), dirname)

            # Get data
            data = self.resources.packages.get(self.package)
            distribution = self.resources.distribution

            self.spec_version = distribution.get('packages').get(self.package)
            self.package_name = data.get('release').get('package_name')
            self.extension = data.get('release').get('extension')
            platform = platform or self._get_platform()
github FPGAwars / apio / apio / commands / system.py View on Github external
def cli(ctx, lsftdi, lsusb, lsserial, info):
    """System tools.\n
       Install with `apio install system`"""

    exit_code = 0

    if lsftdi:
        exit_code = System().lsftdi()
    elif lsusb:
        exit_code = System().lsusb()
    elif lsserial:
        exit_code = System().lsserial()
    elif info:
        click.secho('Platform: ', nl=False)
        click.secho(get_systype(), fg='yellow')
    else:
        click.secho(ctx.get_help())

    ctx.exit(exit_code)
github FPGAwars / apio / apio / commands / system.py View on Github external
def cli(ctx, lsftdi, lsusb, lsserial, info):
    """System tools.\n
       Install with `apio install system`"""

    exit_code = 0

    if lsftdi:
        exit_code = System().lsftdi()
    elif lsusb:
        exit_code = System().lsusb()
    elif lsserial:
        exit_code = System().lsserial()
    elif info:
        click.secho('Platform: ', nl=False)
        click.secho(get_systype(), fg='yellow')
    else:
        click.secho(ctx.get_help())

    ctx.exit(exit_code)