# HG changeset patch # User Mads Kiilerich # Date 2016-07-28 16:28:34 # Node ID dd676fdeda0fab2921ce79f2d2f797c6159d1603 # Parent 51b1af58589bf975eacf187d6f613d210b3f1db5 setup: move test dependencies to dev_requirements.txt to make them optional Remove the need for having test tools on production systems. Installing test dependencies is made an extra explicit step. pip is the future, but doesn't have the same tests_require features as setuptools kind of has. I don't like this way of handling it without setup.py support and with explicit naming of the ugly dev_requirements.txt ... but that seems to be the way to do it. diff --git a/dev_requirements.txt b/dev_requirements.txt new file mode 100644 --- /dev/null +++ b/dev_requirements.txt @@ -0,0 +1,6 @@ +pytest>=2.7.0,<3.0 +pytest-runner +pytest-sugar>=0.7.0,<1.0.0 +webtest==1.4.3 +mock +sphinx diff --git a/docs/contributing.rst b/docs/contributing.rst --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -48,11 +48,15 @@ on Bitbucket_ and create a local clone o Running tests ------------- -After finishing your changes make sure all tests pass cleanly. You can run -the testsuite by running ``py.test`` from the project root:: +After finishing your changes make sure all tests pass cleanly. Install the test +dependencies, then run the testsuite by invoking ``py.test`` from the +project root:: + pip install -r dev_requirements.txt py.test +Note that testing on Python 2.6 also requires ``unittest2``. + You can also use ``tox`` to run the tests with all supported Python versions (currently Python 2.6--2.7). diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -38,7 +38,6 @@ requirements = [ "alembic>=0.8.0,<0.9", "waitress==0.8.8", "webob>=1.0.8,<=1.1.1", - "webtest==1.4.3", "Pylons>=1.0.0,<=1.0.2", "Beaker==1.6.4", "WebHelpers==1.3", @@ -52,24 +51,19 @@ requirements = [ "python-dateutil>=1.5.0,<2.0.0", "markdown==2.2.1", "docutils>=0.8.1,<=0.11", - "mock", "URLObject==2.3.4", "Routes==1.13", - "pytest>=2.7.0,<3.0", - "pytest-sugar>=0.7.0,<1.0.0", "dulwich>=0.14.1", "mercurial>=2.9,<3.9", ] if sys.version_info < (2, 7): requirements.append("importlib==1.0.1") - requirements.append("unittest2") requirements.append("argparse") if not is_windows: requirements.append("bcrypt>=2.0.0") - dependency_links = [ ] @@ -147,9 +141,7 @@ setup( url=__url__, install_requires=requirements, classifiers=classifiers, - setup_requires=['PasteScript>=1.6.3', - 'pytest-runner'], - tests_require=['pytest'], + setup_requires=['PasteScript>=1.6.3'], data_files=data_files, packages=packages, include_package_data=True, diff --git a/tox.ini b/tox.ini --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,8 @@ envlist = py{26,27}-pytest setenv = PYTHONHASHSEED = 0 deps = - pytest: pytest + -r{toxinidir}/dev_requirements.txt + py26-pytest: unittest2 python-ldap python-pam commands =