Skip to content

Commit

Permalink
Fix setup import error
Browse files Browse the repository at this point in the history
`import gspread` statement caused requests packaged to be imported before
dependency could be installed. Sole purpose of import was to extract the
__version__ string field on the module.

Solution is to use a regex to read the version string from __init__.py

Fixes #317
  • Loading branch information
msuozzo committed Oct 20, 2015
1 parent 63d26ce commit c3f066b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python

import os.path
import re
import sys

import gspread

try:
from setuptools import setup
except ImportError:
Expand Down Expand Up @@ -32,12 +31,15 @@ def read(filename):

long_description = long_description.lstrip("\n").format(index=read('docs/index.txt'))

version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
read('gspread/__init__.py'), re.MULTILINE).group(1)

setup(
name='gspread',
packages=['gspread'],
description=description,
long_description=long_description,
version=gspread.__version__,
version=version,
author='Anton Burnashev',
author_email='fuss.here@gmail.com',
url='https://github.com/burnash/gspread',
Expand Down

0 comments on commit c3f066b

Please sign in to comment.