File: version.py

package info (click to toggle)
python-a2wsgi 1.10.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 204 kB
  • sloc: python: 1,187; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import importlib
import os
import subprocess
import sys

here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


def get_version() -> str:
    """
    Return version.
    """
    sys.path.insert(0, here)
    return importlib.import_module("a2wsgi").__version__


os.chdir(here)
subprocess.check_call(f"pdm version {get_version()}", shell=True)
subprocess.check_call("git add a2wsgi/__init__.py pyproject.toml", shell=True)
subprocess.check_call(f'git commit -m "v{get_version()}"', shell=True)
subprocess.check_call("git push", shell=True)
subprocess.check_call("git tag v{0}".format(get_version()), shell=True)
subprocess.check_call("git push --tags", shell=True)