Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 876cf73

Browse files
committed
get version by re
1 parent 7fdaac0 commit 876cf73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
import re
5+
from os.path import join, dirname
6+
7+
with open(join(dirname(__file__), 'thriftpy', '__init__.py'), 'r') as f:
8+
version = re.match(r".*__version__ = '(.*?)'", f.read(), re.S).group(1)
9+
410
from setuptools import setup, find_packages
511
from setuptools.extension import Extension
612

@@ -44,7 +50,7 @@
4450
["thriftpy/protocol/cybin/cybin.c"]))
4551

4652
setup(name="thriftpy",
47-
version=__import__('thriftpy').__version__,
53+
version=version,
4854
description="Pure python implemention of Apache Thrift.",
4955
keywords="thrift python thriftpy",
5056
author="Lx Yu",

0 commit comments

Comments
 (0)