File: __init__.py

package info (click to toggle)
python-pbcommand 2.1.1%2Bgit20231020.28d1635-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,016 kB
  • sloc: python: 7,676; makefile: 220; sh: 73
file content (27 lines) | stat: -rw-r--r-- 576 bytes parent folder | download
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
from importlib.metadata import Distribution, PackageNotFoundError
import sys

try:
    __VERSION__ = Distribution.from_name('pbcommand').version
except PackageNotFoundError:
    __VERSION__ = '2.4.0'

VERSION = (int(x) for x in __VERSION__.split('.'))


def get_version():
    """Return the version as a string. "1.0.0"

    This uses a major.minor.tiny to be compatible with semver spec.

    .. note:: This should be improved to be compliant with PEP 386.
    """
    return ".".join([str(i) for i in VERSION])


def to_ascii(s):
    return s


def to_utf8(s):
    return s