File: utils.py

package info (click to toggle)
austin 3.7.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,444 kB
  • sloc: ansic: 8,622; python: 2,669; sh: 106; makefile: 54
file content (13 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
from pathlib import Path

HERE = Path(__file__).parent


def get_current_version_from_changelog() -> str:
    with (HERE.parent / "ChangeLog").open() as cl:
        for line in cl.readlines():
            if not line or line.startswith(" "):
                continue
            _, _, version = line.partition(" ")
            if version[0] == "v":
                return version[1:].strip()