From aecc91d8a9ef8f71bd4a88738e6bf1578233b264 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 8 Feb 2017 16:00:46 -0500 Subject: [PATCH] remove highest_semver.py This tool is no longer used. Change-Id: I039ed6652de97a2012174cdfa4cc876580508642 Signed-off-by: Doug Hellmann --- README.rst | 8 ------- highest_semver.py | 54 ----------------------------------------------- 2 files changed, 62 deletions(-) delete mode 100755 highest_semver.py diff --git a/README.rst b/README.rst index 30216c7..9895441 100644 --- a/README.rst +++ b/README.rst @@ -700,14 +700,6 @@ To clean up Nova kilo blueprints:: ./autokick.py nova kilo -highest_semver.py ------------------ - -Reads a list of version tags from standard input and prints the -"highest" value as output, ignoring tags that don't look like valid -versions. - - translation-cleanup.sh ---------------------- diff --git a/highest_semver.py b/highest_semver.py deleted file mode 100755 index f331970..0000000 --- a/highest_semver.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -"""Read a list of version tags from stdin and pick the one with the -highest semver value. -""" - -from __future__ import print_function - -import fileinput -import sys - - -tags = [] -for line in fileinput.input(sys.argv[1:]): - line = line.strip() - if not line: - continue - parts = line.split('.') - try: - v = tuple(int(val) for val in parts) - except ValueError: - # This tag is probably an alpha, so ignore it - continue - if len(v) == 3: - v = v + ('zzz',) # artifically sort the value higher than alphas - # Ignore versions where the beginning doesn't look like a number, - # such as 'havana-eol' - if not isinstance(v[0], int): - continue - # Ignore date-based entries - if v[0] > 100: - continue - tags.append(v) - -if tags: - # We only want to print something if we actually have any tags to - # pick from. Otherwise we probably have a library that has never - # been released, so there is no valid version. - version = max(tags) - if version[-1] == 'zzz': - version = version[:-1] - print('.'.join(str(t) for t in version))