Permalink
Browse files

Use requirements.txt for install_requires in setup.py

  • Loading branch information...
wbolster committed May 30, 2012
1 parent 1e05b9e commit c524115afdb126d12c59d52deb3cc0f8445f78f0
Showing with 13 additions and 4 deletions.
  1. +13 −4 setup.py
View
@@ -4,21 +4,30 @@
execfile('happybase/_version.py')
-def readfile(filename):
+def get_file_contents(filename):
with open(join(dirname(__file__), filename)) as fp:
return fp.read()
-description = readfile('README.rst')
+
+def get_install_requires():
+ requirements = get_file_contents('requirements.txt')
+ install_requires = []
+ for line in requirements.split('\n'):
+ line = line.strip()
+ if line and not line.startswith('-'):
+ install_requires.append(line)
+ return install_requires
+
setup(name='happybase',
version=__version__,
description="A developer-friendly Python library to interact "
"with Apache HBase",
- long_description=description,
+ long_description=get_file_contents('README.rst'),
author="Wouter Bolsterlee",
author_email="uws@xs4all.nl",
url='https://github.com/wbolster/happybase',
- install_requires=['thrift'],
+ install_requires=get_install_requires(),
packages=find_packages(exclude=['tests']),
license="MIT",
classifiers=(

0 comments on commit c524115

Please sign in to comment.