How to use the apio.resources.Resources function in apio

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 / 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 / install.py View on Github external
def cli(ctx, packages, all, list, force, platform):
    """Install packages."""

    if packages:
        for package in packages:
            Installer(package, platform, force).install()
    elif all:  # pragma: no cover
        packages = Resources(platform).packages
        for package in packages:
            Installer(package, platform, force).install()
    elif list:
        Resources(platform).list_packages(installed=True, notinstalled=True)
    else:
        click.secho(ctx.get_help())
github FPGAwars / apio / apio / commands / uninstall.py View on Github external
def cli(ctx, packages, all, list, platform):
    """Uninstall packages."""

    if packages:
        _uninstall(packages, platform)
    elif all:  # pragma: no cover
        packages = Resources(platform).packages
        _uninstall(packages, platform)
    elif list:
        Resources(platform).list_packages(installed=True, notinstalled=False)
    else:
        click.secho(ctx.get_help())
github FPGAwars / apio / apio / managers / system.py View on Github external
def __init__(self):
        profile = Profile()
        resources = Resources()

        self.name = 'system'
        self.version = util.get_package_version(self.name, profile)
        self.spec_version = util.get_package_spec_version(self.name, resources)

        self.ext = ''
        if 'Windows' == platform.system():
            self.ext = '.exe'
github FPGAwars / apio / apio / managers / examples.py View on Github external
def __init__(self):
        profile = Profile()
        resources = Resources()

        self.name = 'examples'
        self.examples_dir = util.get_package_dir(self.name)
        self.version = util.get_package_version(self.name, profile)
        self.spec_version = util.get_package_spec_version(self.name, resources)
github FPGAwars / apio / apio / managers / scons.py View on Github external
def __init__(self, project_dir=''):
        self.profile = Profile()
        self.resources = Resources()

        if project_dir is not None:
            # Move to project dir
            project_dir = util.check_dir(project_dir)
            os.chdir(project_dir)
github FPGAwars / apio / apio / managers / drivers.py View on Github external
def _setup_windows(self):
        profile = Profile()
        resources = Resources()

        self.name = 'drivers'
        self.version = util.get_package_version(self.name, profile)
        self.spec_version = util.get_package_spec_version(self.name, resources)
github FPGAwars / apio / apio / commands / install.py View on Github external
def cli(ctx, packages, all, list, force, platform):
    """Install packages."""

    if packages:
        for package in packages:
            Installer(package, platform, force).install()
    elif all:  # pragma: no cover
        packages = Resources(platform).packages
        for package in packages:
            Installer(package, platform, force).install()
    elif list:
        Resources(platform).list_packages(installed=True, notinstalled=True)
    else:
        click.secho(ctx.get_help())
github FPGAwars / apio / apio / commands / uninstall.py View on Github external
def cli(ctx, packages, all, list, platform):
    """Uninstall packages."""

    if packages:
        _uninstall(packages, platform)
    elif all:  # pragma: no cover
        packages = Resources(platform).packages
        _uninstall(packages, platform)
    elif list:
        Resources(platform).list_packages(installed=True, notinstalled=False)
    else:
        click.secho(ctx.get_help())
github FPGAwars / apio / apio / commands / boards.py View on Github external
def cli(ctx, list, fpga):
    """Manage FPGA boards."""

    if list:
        Resources().list_boards()
    elif fpga:
        Resources().list_fpgas()
    else:
        click.secho(ctx.get_help())