Parse requirements.txt in setup.py. Fix #273 (#284)

This commit is contained in:
Alexis Metaireau 2017-11-01 18:36:44 +01:00 committed by GitHub
parent 9d7376d46b
commit 9d67c32a84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 24 deletions

View file

@ -1,3 +1,3 @@
include *.rst
recursive-include ihatemoney *.rst *.py *.yaml *.po *.mo *.html *.css *.js *.eot *.svg *.woff *.txt *.png *.ini *.cfg
include LICENSE CONTRIBUTORS CHANGELOG.rst
include LICENSE CONTRIBUTORS CHANGELOG.rst requirements.txt

View file

@ -2,6 +2,16 @@
import codecs
import os
from setuptools import setup, find_packages
try:
from pip.req import parse_requirements
from pip.download import PipSession
except ImportError:
print('[libbmc] pip not found.')
raise
# Get requirements from the requirements.txt file.
pip_requirements = parse_requirements("requirements.txt", session=PipSession())
install_requires = [str(ir.req) for ir in pip_requirements]
here = os.path.abspath(os.path.dirname(__file__))
@ -16,25 +26,6 @@ def read_file(filename):
README = read_file('README.rst')
CHANGELOG = read_file('CHANGELOG.rst')
REQUIREMENTS = [
'flask>=0.11',
'flask-wtf>=0.13',
'flask-sqlalchemy',
'flask-mail>=0.8',
'Flask-Migrate>=1.8.0',
'Flask-script',
'flask-babel',
'flask-rest',
'jinja2>=2.6',
'raven',
'blinker',
'six>=1.10',
'itsdangerous>=0.24',
]
DEPENDENCY_LINKS = [
]
ENTRY_POINTS = {
'paste.app_factory': [
'main = ihatemoney.run:main',
@ -52,9 +43,11 @@ setup(name='ihatemoney',
license='Custom BSD Beerware',
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
@ -66,6 +59,5 @@ setup(name='ihatemoney',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=REQUIREMENTS,
dependency_links=DEPENDENCY_LINKS,
entry_points=ENTRY_POINTS)
install_requires=install_requires,
entry_points=ENTRY_POINTS)