Skip to content

Commit

Permalink
Use get_version() to avoid race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaprise committed Oct 9, 2015
1 parent fee8837 commit 78ccda3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import re
import sys
from setuptools import setup

from serpextract import __version__ as version

# Get version without importing, which avoids dependency issues
def get_version():
with open('serpextract/__init__.py') as version_file:
return re.search(r"""__version__\s+=\s+(['"])(?P<version>.+?)\1""",
version_file.read()).group('version')

install_requires = [
'iso3166 >= 0.4',
Expand All @@ -17,7 +21,7 @@

setup(
name='serpextract',
version=version,
version=get_version(),
author='Mike Sukmanowsky',
author_email='mike@parsely.com',
packages=['serpextract',],
Expand Down

0 comments on commit 78ccda3

Please sign in to comment.