From 7403bfe49395417fe2597d94bd83fae14c1fb4bb Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Tue, 19 Aug 2014 11:28:07 +0200 Subject: [PATCH] Refactor for nicer test setup. ``python setup.py test`` works out of the box. Added tox.ini. --- MANIFEST.in | 3 +++ setup.py | 36 ++++++++++++++++++++---------------- tox.ini | 13 +++++++++++++ 3 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 MANIFEST.in create mode 100644 tox.ini diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c7e6a5a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include CHANGES.txt +include README.rst +include README.txt diff --git a/setup.py b/setup.py index 7fc9999..612ac53 100644 --- a/setup.py +++ b/setup.py @@ -24,30 +24,33 @@ long_description = "\n\n".join((README, CHANGES)) long_description = long_description.decode('utf-8') -install_requires =[ +requires = [ 'setuptools', 'Chameleon >= 2.7', 'zope.interface', 'zope.component', 'zope.configuration', - 'zope.testing', 'pyramid >= 1.4', 'pyramid_zcml >= 0.9.2', ] -tests_require = [] +docs_extras = [ + 'Sphinx', + 'docutils', + 'repoze.sphinx.autointerface'] + +testing_extras = [ + 'manuel', + 'coverage', + 'nose', + 'zope.testing>3.8.7', + 'zope.component>3.9.2'] if sys.platform == "darwin": - tests_require.append("MacFSEvents") + testing_extras.append("MacFSEvents") if sys.platform.startswith("linux"): - tests_require.append("pyinotify") - -tests_require = install_requires + [ - 'manuel', - 'zope.testing>3.8.7', - 'zope.component>3.9.2', - ] + tests_require + testing_extras.append("pyinotify") setup(name='pyramid_skins', version = '1.1', @@ -75,10 +78,11 @@ namespace_packages=[], include_package_data = True, zip_safe = False, - install_requires=install_requires, - tests_require = tests_require, - extras_require = { - 'tests': [dep.split('==')[0] for dep in tests_require], - }, + install_requires=requires, + tests_require=testing_extras, + extras_require={ + 'testing': testing_extras, + 'docs': docs_extras, + 'development': testing_extras + docs_extras}, test_suite="pyramid_skins.tests", ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..4f138fe --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +[tox] +envlist = + py27,pyramid14 + +[testenv] +commands = + pip install pyramid_skins[testing] + nosetests + +[testenv:pyramid14] +basepython = python2.7 +deps = + pyramid>=1.4,<1.5