Skip to content

Commit

Permalink
Merge pull request Meiqia#5 from Parsely/fix/version
Browse files Browse the repository at this point in the history
Use get_version() to avoid race condition in setup.py
  • Loading branch information
msukmanowsky committed Oct 9, 2015
2 parents fee8837 + 78ccda3 commit 21a5731
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 21a5731

Please sign in to comment.