diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-01-09 16:19:54 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-01-27 15:17:15 +0100 |
commit | e4c98626fa0306b723719539d3214e829f9b2d76 (patch) | |
tree | b0c6262905799c57d777ada19a645ca70c08b05d /dlpcvp.py | |
parent | 344f6d1120a66bb1228b6f991e0bf1f0ebb09bf1 (diff) | |
download | dlp_check_version_PyPI-e4c98626fa0306b723719539d3214e829f9b2d76.tar.gz |
Start working on actors
Diffstat (limited to 'dlpcvp.py')
-rwxr-xr-x | dlpcvp.py | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -13,6 +13,7 @@ from distutils.version import LooseVersion from typing import Iterable, List, Optional, Tuple, Union from urllib.error import URLError, HTTPError from urllib.request import Request, urlopen +import thespian # PyPI API documentation https://warehouse.readthedocs.io/api-reference/ PyPI_base = "https://pypi.org/pypi/{}/json" @@ -278,6 +279,11 @@ def package_version(proj: str, pkgn: str, return None +class SUSEPkgVerifier(thespian.actors.Actor): + def receiveMessage(self, message, sender): + pass + + def main(prj): db_name = osp.splitext(osp.basename(osp.realpath(__file__)))[0] + ".db" to_be_upgraded = [] # type: List[Tuple[str, LooseVersion, LooseVersion]] @@ -288,7 +294,7 @@ def main(prj): conn.execute(TB_CREATE_IDX) for pkg in suse_packages(prj): - log.debug(f'pkg = {pkg}') + log.debug('pkg = %s', pkg) print(pkg[0], file=sys.stderr, end='', flush=True) if pkg.startswith('python-'): pypi_name = pkg[CUTCHARS:] @@ -302,7 +308,7 @@ def main(prj): if pypi_ver is None: raise RuntimeError('not in PyPI') except RuntimeError as ex: - log.warning(f'Package {pkg} cannot be found: {ex}') + log.warning('Package %s cannot be found: %s', pkg, ex) continue except URLError as ex: log.warning( @@ -314,8 +320,8 @@ def main(prj): if pypi_ver > suse_ver: to_be_upgraded.append((pkg, suse_ver, pypi_ver)) except TypeError: - log.warning(f'{pkg} pypi_ver = {pypi_ver}') - log.warning(f'{pkg} suse_ver = {suse_ver}') + log.warning('%s pypi_ver = %s', pkg, pypi_ver) + log.warning('%s suse_ver = %s', pkg, suse_ver) continue else: missing_on_PyPI.append(pkg) @@ -323,7 +329,7 @@ def main(prj): sys.stdout.flush() if missing_on_PyPI: print("\nThese packages don't seem to be available on PyPI:") - print("{}\n".format('\n'.join(missing_on_PyPI))) + print('{}\n'.format('\n'.join(missing_on_PyPI))) if to_be_upgraded: print('These packages need to be upgraded:') |