Skip to content

Commit 1bf3f71

Browse files
committed
Add version info into package.
1 parent feea588 commit 1bf3f71

8 files changed

Lines changed: 45 additions & 2 deletions

File tree

_version/__init__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
_version
3+
4+
Version information for cobs.
5+
"""
6+
7+
__all__ = [
8+
'VERSION_MAJOR',
9+
'VERSION_MINOR',
10+
'VERSION_PATCH',
11+
'VERSION_STRING',
12+
'__version__',
13+
]
14+
15+
VERSION_MAJOR = 1
16+
VERSION_MINOR = 1
17+
VERSION_PATCH = 0
18+
19+
VERSION_STRING = '%s.%s.%s' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
20+
21+
__version__ = VERSION_STRING
22+

python2/cobs/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212

1313
#import cobs
1414
#import cobsr
15+
16+
from _version import *
17+

python2/cobs/cobs/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@
2424
_using_extension = False
2525

2626
DecodeError.__module__ = 'cobs.cobs'
27+
28+
from cobs._version import *
29+

python2/cobs/cobsr/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
_using_extension = False
1818

1919
DecodeError.__module__ = 'cobs.cobsr'
20+
21+
from cobs._version import *
22+

python3/cobs/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212

1313
#from . import cobs
1414
#from . import cobsr
15+
16+
from ._version import *
17+

python3/cobs/cobs/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@
2424
_using_extension = False
2525

2626
DecodeError.__module__ = 'cobs.cobs'
27+
28+
from .._version import *
29+

python3/cobs/cobsr/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
_using_extension = False
1818

1919
DecodeError.__module__ = 'cobs.cobsr'
20+
21+
from .._version import *
22+

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@
44
from distutils.core import setup
55
from distutils.extension import Extension
66

7+
import _version
8+
79
if sys.version_info[0] == 2:
810
base_dir = 'python2'
911
elif sys.version_info[0] == 3:
1012
base_dir = 'python3'
1113

1214
setup(
1315
name='cobs',
14-
version='1.1.0',
16+
version=_version.__version__,
1517
description='Consistent Overhead Byte Stuffing (COBS)',
1618
author='Craig McQueen',
1719
author_email='python@craig.mcqueen.id.au',
1820
url='http://bitbucket.org/cmcqueen1975/cobs-python/',
19-
packages=[ 'cobs', 'cobs.cobs', 'cobs.cobsr', ],
21+
packages=[ 'cobs', 'cobs.cobs', 'cobs.cobsr', 'cobs._version', ],
2022
package_dir={
2123
'cobs' : base_dir + '/cobs',
24+
'cobs._version' : '_version',
2225
},
2326
ext_modules=[
2427
Extension('cobs.cobs._cobs_ext', [ base_dir + '/src/_cobs_ext.c', ]),

0 commit comments

Comments
 (0)