| 1 | def latest(versions): |
| 2 | """Return the newest semantic version string, e.g. '1.10.0'.""" |
| 3 | if not versions: |
| 4 | raise ValueError("no versions") |
| 5 | return max(versions) |
| 6 | |
| 7 | |
| 8 | def is_upgrade(current, candidate): |
| 9 | return latest([current, candidate]) == candidate and current != candidate |
| 10 |