File size: 741 Bytes
6288873
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import importlib.metadata
import pathlib
import subprocess

__version__ = importlib.metadata.version("varipeps")

try:
    git_commit = (
        subprocess.check_output(
            ["git", "rev-parse", "HEAD"],
            cwd=pathlib.Path(__file__).parent,
            stderr=subprocess.DEVNULL,
        )
        .decode("ascii")
        .strip()
    )
except subprocess.CalledProcessError:
    git_commit = None

try:
    git_tag = (
        subprocess.check_output(
            ["git", "describe", "--exact-match", "--tags", "HEAD"],
            cwd=pathlib.Path(__file__).parent,
            stderr=subprocess.DEVNULL,
        )
        .decode("ascii")
        .strip()
    )
except subprocess.CalledProcessError:
    git_tag = None