aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2019-03-03 00:34:27 +0100
committerMatěj Cepl <mcepl@cepl.eu>2019-03-03 00:34:27 +0100
commit0c6c28cf5c8c7515ecc84350a5b99cc63c91f6f6 (patch)
treea0b24d02b3290c4c41fa317df0727e174dea7a5e
parent64b0982eed306aa834cb83d82b34e8ce1e7d83db (diff)
downloaddlp_check_version_PyPI-0c6c28cf5c8c7515ecc84350a5b99cc63c91f6f6.tar.gz
Modifications for d:l:python.
-rwxr-xr-xdlpcvp.py26
-rw-r--r--exceptions.json73
2 files changed, 83 insertions, 16 deletions
diff --git a/dlpcvp.py b/dlpcvp.py
index ee44474..7b74a20 100755
--- a/dlpcvp.py
+++ b/dlpcvp.py
@@ -65,6 +65,7 @@ def suse_packages(proj: str) -> Iterable[str]:
with open('exceptions.json') as exc_f:
exc_dict = json.load(exc_f)
+ exc_list = [] # type: List[str]
if proj in exc_dict:
exc_list = exc_dict[proj]
@@ -74,6 +75,10 @@ def suse_packages(proj: str) -> Iterable[str]:
root = raw_xml_data.getroot()
for elem in root.iter('entry'):
pkg_name = elem.get('name')
+ # We don't want -doc subpackages
+ if pkg_name.endswith('-doc'):
+ continue
+ # Nor we want packages which we specifically excluded
if pkg_name in exc_list:
continue
yield pkg_name
@@ -226,6 +231,8 @@ def package_version(proj: str, pkg_name: str,
def main(prj):
db_name = osp.splitext(osp.basename(osp.realpath(__file__)))[0] + ".db"
+ to_be_upgraded = [] # type: List[Tuple[str, LooseVersion, LooseVersion]]
+ missing_on_PyPI = [] # type: List[str]
with sqlite3.connect(db_name) as conn:
if not conn.execute(TB_EXISTS).fetchone():
conn.execute(TB_CREATE)
@@ -248,23 +255,32 @@ def main(prj):
try:
if pypi_ver > suse_ver:
- print(
- f'We need to upgrade {pkg} ({suse_ver} -> {pypi_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}')
continue
else:
- print(f'Is {pkg} on PyPI?')
+ missing_on_PyPI.append(pkg)
+
+ 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)))
+
+ if to_be_upgraded:
+ print('These packages need to be upgraded:')
+ for pkg_upgr in to_be_upgraded:
+ print(f'{pkg_upgr[0]} ({pkg_upgr[1]} -> {pkg_upgr[2]})')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Check available versions '
'of the upstream packages on PyPI')
- parser.add_argument('--opensuse-project',
+ parser.add_argument('project', nargs='?',
default='devel:languages:python:numeric',
help='The OpenBuildService project. Defaults '
'to %(default)s')
args = parser.parse_args()
- sys.exit(main(args.opensuse_project))
+ sys.exit(main(args.project))
diff --git a/exceptions.json b/exceptions.json
index fa6f802..8c068e5 100644
--- a/exceptions.json
+++ b/exceptions.json
@@ -1,13 +1,64 @@
{
- "devel:languages:python:numeric": [
- "mayavi",
- "opensesame",
- "python-espressopp",
- "python-pyo",
- "python2-matplotlib",
- "python3-espressomd",
- "spyder",
- "spyder3",
- "ViTables"
- ]
+ "devel:languages:python:numeric": [
+ "mayavi",
+ "opensesame",
+ "python-espressopp",
+ "python-pyo",
+ "python2-matplotlib",
+ "python3-espressomd",
+ "spyder",
+ "spyder3",
+ "ViTables"
+ ],
+ "devel:languages:python": [
+ "python-3parclient",
+ "python-CDDB",
+ "python-Levenshtein",
+ "python-abseil",
+ "python-aci-integration-module",
+ "python-antlr3_runtime",
+ "python-axolotl",
+ "python-axolotl-curve25519",
+ "python-cairo",
+ "python-distutils-extra",
+ "python-djvulibre",
+ "python-dukpy-kovidgoyal",
+ "python-epubmerge",
+ "python-espeak",
+ "python-evtx",
+ "python-goocanvas",
+ "python-gpgme",
+ "python-gtk",
+ "python-gtksourceview",
+ "python-iptables",
+ "python-jaraco.base",
+ "python-jedihttp",
+ "python-keyczar",
+ "python-killswitch",
+ "python-liblarch",
+ "python-linux-procfs",
+ "python-markdown-math",
+ "python-mhash",
+ "python-nss",
+ "python-onionshare",
+ "python-opengl",
+ "python-opengl-accelerate",
+ "python-openqa_client",
+ "python-parted",
+ "python-pocketsphinx-python",
+ "python-prompt_toolkit1",
+ "python-pycxx",
+ "python-pygments-style-railscasts",
+ "python-pyotherside",
+ "python-pysvn",
+ "python-sge-pygame",
+ "python-usb",
+ "python-virtkey",
+ "python-xsge_gui",
+ "python-xsge_lighting",
+ "python-xsge_particle",
+ "python-xsge_path",
+ "python-xsge_physics",
+ "python-xsge_tmx"
+ ]
}