Read version number from tqdm/_version.py

This commit is contained in:
Hadrien Mary 2015-10-11 18:55:34 +02:00 committed by Casper da Costa-Luis
parent 9e37070c73
commit 45c791954e
2 changed files with 13 additions and 2 deletions

View File

@ -1,8 +1,15 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tqdm._version import __version__
import os
from setuptools import setup
# Get version from tqdm/_version.py
__version__ = None
version_file = os.path.join(os.path.dirname(__file__), 'tqdm', '_version.py')
for line in open(version_file).readlines():
if (line.startswith('version_info') or line.startswith('__version__')):
exec(line.strip())
setup(
name='tqdm',
version=__version__,

View File

@ -1 +1,5 @@
__version__ = '2.0-dev'
# Definition of the version number
version_info = 2, 0, 0, 'dev' # major, minor, patch, extra
# Nice string for the version (mimic how IPython composes its version str)
__version__ = '-'.join(map(str, version_info)).replace('-', '.').strip('-')