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
|