Skip to content

Commit

Permalink
Fix setup.py
Browse files Browse the repository at this point in the history
* make requirements.txt match more recent versions in setup.py
* read requirements.txt to get versions for dependency list in setup.py
* don't import dependences in Quandl.__init__.py until you've had a chance to install them!
  • Loading branch information
Hobson Lane committed Dec 14, 2014
1 parent e6a0ec0 commit efa9858
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 26 deletions.
36 changes: 22 additions & 14 deletions Quandl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@
__license__ = 'MIT'
__version__ = '1.5'

from .Quandl import (
get,
push,
search,
WrongFormat,
MultisetLimit,
ParsingError,
CallLimitExceeded,
DatasetNotFound,
ErrorDownloading,
MissingToken,
DateNotRecognized,
CodeFormatError
)
#############################################
#
# Don't import anything in __init__.py!
# Otherwise setup.py can't import the private constants above (__authors__, etc)
# because it won't have installed dependencies yet!
#
# from .Quandl import (
# get,
# push,
# search,
# WrongFormat,
# MultisetLimit,
# ParsingError,
# CallLimitExceeded,
# DatasetNotFound,
# ErrorDownloading,
# MissingToken,
# DateNotRecognized,
# CodeFormatError
# )
#
###############################################
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
numpy==1.7.1
pandas==0.11
numpy>=1.8
pandas>=0.14
37 changes: 27 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
from Quandl import __version__, __authors__, __github_url__, __maintainer__, __email__, __url__, __license__
from Quandl import __name__ as package_name
import os

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

import Quandl
try:
from pip.req import parse_requirements
requirements = list(parse_requirements('requirements.txt'))
except:
requirements = []
install_requires=[str(req).split(' ')[0].strip() for req in requirements if req.req and not req.url]
print 'Install requirements found in requirements.txt: %r' % install_requires
dependency_links=[req.url for req in requirements if req.url]
print 'Dependencies found in requirements.txt: %r' % dependency_links


setup(name = 'Quandl',
setup(
name = package_name,
description = 'Package for Quandl API access',
version = Quandl.__version__,
author = ", ".join(Quandl.__authors__),
maintainer = Quandl.__maintainer__,
maintainer_email = Quandl.__email__,
url = Quandl.__url__,
license = Quandl.__license__,
long_description = open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
version = __version__,
author = ", ".join(__authors__),
maintainer = __maintainer__,
maintainer_email = __email__,
url = __url__,
license = __license__,
install_requires = [
"pandas >= 0.14",
"numpy >= 1.8",
"pandas >= 0.14",
"numpy >= 1.8",
],
# install_requires = install_requires,
dependency_links = dependency_links,
packages = ['Quandl'],
)

0 comments on commit efa9858

Please sign in to comment.