From 18fcbde9eaaa490f8b797c9c413c444d09b8d4fc Mon Sep 17 00:00:00 2001 From: tomer gelber Date: Fri, 3 Oct 2014 15:58:16 +0300 Subject: [PATCH] splat requirements to regular and test. setup reading regular. added more dynamically calculating. --- .travis.yml | 1 + pymal/__init__.py | 4 +--- requirements.txt | 8 ++------ setup.py | 26 +++++++++++++------------- test_requirements.txt | 6 ++++++ 5 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 test_requirements.txt diff --git a/.travis.yml b/.travis.yml index b4d5e7d..831ecc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: # command to install dependencies install: - "pip install -r requirements.txt" + - "pip install -r test_requirements.txt" # command to run tests script: nosetests --with-coverage --cover-package=pymal after_success: diff --git a/pymal/__init__.py b/pymal/__init__.py index 419ec84..a1eaf56 100644 --- a/pymal/__init__.py +++ b/pymal/__init__.py @@ -1,7 +1,5 @@ -__authors__ = "" -__copyright__ = "(c) 2014, pymal" +__authors__ = "pymal-developers" __license__ = "BSD License" -__contact__ = "Name Of Current Guardian of this file " __all__ = ['account', 'anime', 'manga', 'seasons'] diff --git a/requirements.txt b/requirements.txt index 1a87f5e..7612a73 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,13 @@ # This is an implicit value, here for clarity --index-url https://pypi.python.org/simple/ -# Those are like in setup.py +# Those are required for running beautifulsoup4>=4.3.2 html5lib>=0.999 httpcache>=0.1.3 six==1.3 requests>=2.4.1 -pillow>=2.5.3 +pillow>=2.6.0 singleton3>=1.0 singleton-factory>=0.1 reloaded-set>=0.3 - -# This is needed for tests -coveralls>=0.4.2 -mock==1.0.1 diff --git a/setup.py b/setup.py index 471b4c8..0d7f8b7 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,25 @@ from setuptools import setup, find_packages +from pip.req import parse_requirements # Dynamically calculate the version based on pymal.__version__. version = __import__('pymal').__version__ +# Dynamically calculate the license based on pymal.__license__. +license = __import__('pymal').__license__ + +# Dynamically calculate the authors based on pymal.__authors__. +authors = __import__('pymal').__authors__ + +requirements_path = 'requirements.txt' setup( name='pymal', packages=find_packages(exclude=['tests*']), version=version, description='A python api for the website MyAnimeList (or MAL).', - author='pymal-developers', - license="BSD", + author=authors, + license=license, url='https://bitbucket.org/pymal-developers/pymal/', keywords=[ "MyAnimeList", "myanimelist", @@ -48,15 +56,7 @@ 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: User Interfaces', ], - install_requires=[ - 'requests>=2.4.1', - 'beautifulsoup4>=4.3.2', - 'httpcache>=0.1.3', - 'html5lib>=0.999', - 'six==1.3', - 'pillow>=2.5.3', - 'singleton3>=1.0', - 'singleton-factory>=0.1', - 'reloaded-set>=0.3', - ], + + # Dynamically calculate the install_requires based on requirements_path. + install_requires=[str(ir.req) for ir in parse_requirements(requirements_path)], ) diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 0000000..d13042e --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1,6 @@ +# This is an implicit value, here for clarity +--index-url https://pypi.python.org/simple/ + +# This is needed for tests +coveralls>=0.4.4 +mock==1.0.1