File: get-version.py

package info (click to toggle)
python-pytest-asyncio 0.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: python: 3,108; makefile: 26; sh: 1
file content (19 lines) | stat: -rw-r--r-- 429 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import annotations

import json
import sys
from importlib import metadata

from packaging.version import parse as parse_version


def main():
    version_string = metadata.version("pytest-asyncio")
    version = parse_version(version_string)
    print(f"version={version}")
    prerelease = json.dumps(version.is_prerelease)
    print(f"prerelease={prerelease}")


if __name__ == "__main__":
    sys.exit(main())