Skip to content

Commit 9c564fb

Browse files
committed
Merge pull request #28 from ifduyue/export_version
Export VERSION and LZ4_VERSION. Close #19
2 parents 34aa012 + b81fd7d commit 9c564fb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
from setuptools import setup, find_packages, Extension
55

66
VERSION = (0, 7, 0)
7+
VERSION_STR = ".".join([str(x) for x in VERSION])
78

89
setup(
910
name='lz4',
10-
version=".".join([str(x) for x in VERSION]),
11+
version=VERSION_STR,
1112
description="LZ4 Bindings for Python",
1213
long_description=open('README.rst', 'r').read(),
1314
author='Steeve Morin',
@@ -26,6 +27,7 @@
2627
"-Wall",
2728
"-W",
2829
"-Wundef",
30+
"-DVERSION=\"%s\"" % VERSION_STR,
2931
"-DLZ4_VERSION=\"r119\"",
3032
])
3133
],

src/python-lz4.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ void initlz4(void)
202202
INITERROR;
203203
}
204204

205+
PyModule_AddStringConstant(module, "VERSION", VERSION);
206+
PyModule_AddStringConstant(module, "LZ4_VERSION", LZ4_VERSION);
207+
205208
#if PY_MAJOR_VERSION >= 3
206209
return module;
207210
#endif

0 commit comments

Comments
 (0)