Skip to content
Snippets Groups Projects
Commit 12f4d5b0 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Changes version

parent 307f72a3
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python #!/usr/bin/env python
# coding=utf-8 # coding=utf-8
# Filename: __version__.py # Filename: __version__.py
# pylint: disable=C0103
""" """
Pep 386 compliant version info. Pep 386 compliant version info.
(major, minor, micro, alpha/beta/rc/final, #) (major, minor, micro, alpha/beta/rc/final, #)
(1, 1, 2, 'alpha', 0) => "1.1.2.dev"
Example: (1, 2, 0, 'beta', 2) => "1.2b2"
>>> get_version((1, 1, 2, 'alpha', 0))
'1.1.2.dev'
>>> get_version((1, 2, 0, 'beta', 2))
'1.2b2'
""" """
VERSION = (0, 1, 0, 'final', 0) version_info = (0, 2, 0, 'final', 0)
def get_version(version_info): def _get_version(version_info):
"""Return a PEP 386-compliant version number.""" """Return a PEP 386-compliant version number."""
assert len(version_info) == 5 assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final') assert version_info[3] in ('alpha', 'beta', 'rc', 'final')
parts = 2 if version_info[2] == 0 else 3 parts = 2 if version_info[2] == 0 else 3
main = '.'.join([str(part) for part in version_info[:parts]]) main = '.'.join(map(str, version_info[:parts]))
sub = '' sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0: if version_info[3] == 'alpha' and version_info[4] == 0:
...@@ -33,5 +29,4 @@ def get_version(version_info): ...@@ -33,5 +29,4 @@ def get_version(version_info):
return str(main + sub) return str(main + sub)
version = get_version((0, 1, 0, 'final', 0)) version = _get_version(version_info)
from setuptools import setup from setuptools import setup
import controlhost from controlhost import version
setup(name='controlhost', setup(name='controlhost',
version=controlhost.__version__, version=version,
url='https://github.com/tamasgal/controlhost/', url='https://github.com/tamasgal/controlhost/',
description='A set of classes and tools wich uses the ControlHost protocol.', description='A set of classes and tools wich uses the ControlHost protocol.',
author='Tamas Gal', author='Tamas Gal',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment