How to use the andriller.utils.totupe function in andriller

To help you get started, we’ve selected a few andriller 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 den4uk / andriller / andriller / config.py View on Github external
def check_latest_version(self, logger=logger):
        url = f'https://pypi.org/pypi/{__package_name__}/json'
        with suppress(Exception):
            response = requests.get(url)
            if response.ok and response.headers.get('Content-Type') == 'application/json':
                latest = max(response.json()['releases'])
                logger.debug(f'Fetched latest version from PYPI: {latest}')
                if utils.totupe(__version__) < utils.totupe(latest):
                    logger.warning(f'  ** Update available: {latest} **')
                    self.update_available = True