How to use the apio.api.api_request 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 / 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 / packages / scons.py View on Github external
def _get_version(self):
        releases = api_request('tool-scons/releases/latest')
        if releases is not None and 'tag_name' in releases:
            version = releases['tag_name'][1:] # vX -> X
            return version
github FPGAwars / apio / apio / new_installer.py View on Github external
def _get_version(self, name, organization, tag_name):
        version = ''
        releases = api_request('{}/releases/latest'.format(name), organization)
        if releases is not None and 'tag_name' in releases:
            pattern = tag_name.replace('%V', '(?P.*?)') + '$'
            match = re.search(pattern, releases['tag_name'])
            if match:
                version = match.group('v')
        return version
github FPGAwars / apio / apio / packages / examples.py View on Github external
def _get_version(self):
        tags = api_request('apio-examples/tags')
        if tags is not None and type(tags) == list and \
           len(tags) > 0 and 'name' in tags[0]:
            version = tags[0]['name']
            return version