From 3cd83f18fee784ab18761871c035585bad4653d0 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Sun, 2 Feb 2014 14:22:22 +0100 Subject: [PATCH] Add test-requirements.txt The central place for all testing requirements. And use it everywhere. --- .travis.yml | 4 +--- MANIFEST.in | 2 +- setup.py | 9 ++++++++- test-requirements.txt | 3 +++ tox.ini | 3 +-- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 test-requirements.txt diff --git a/.travis.yml b/.travis.yml index 73f10be..8630b43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,5 @@ python: # - "2.6" - "2.7" - "3.3" -# command to install dependencies -install: "pip install -r requirements.txt --use-mirrors" -# command to run tests +install: "pip install --use-mirrors -r test-requirements.txt" script: python test/__main__.py -v diff --git a/MANIFEST.in b/MANIFEST.in index f1cfd46..4fbb947 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include LICENSE include README.rst -include requirements.txt +include requirements.txt test-requirements.txt include tox.ini recursive-include test * diff --git a/setup.py b/setup.py index 70a51d8..f1a92aa 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,12 @@ with codecs.open('README.rst', encoding='utf-8') as f: with open("requirements.txt", "r") as f: install_requires = [str(req) for req in pkg_resources.parse_requirements(f)] - +with open("test-requirements.txt", "r") as f: + test_requires = [] + for line in f.readlines(): + # Skip '-r ...' includes which pkg_resources doesn't understand: + if not line.startswith('-r '): + test_requires.append(str(pkg_resources.Requirement.parse(line))) setup( name='lesscpy', @@ -28,6 +33,8 @@ setup( packages=find_packages(exclude=['*test*']), scripts=['bin/lesscpy'], install_requires=install_requires, + tests_require=test_requires, + test_suite='test', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..63707fe --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt +pep8==1.4.6 +flake8 diff --git a/tox.ini b/tox.ini index b5bdf48..bc7b647 100644 --- a/tox.ini +++ b/tox.ini @@ -2,11 +2,10 @@ envlist = py26,py27,py33,pep8 [testenv] -deps = -r{toxinidir}/requirements.txt +deps = -r{toxinidir}/test-requirements.txt commands = python test/__main__.py -v [testenv:pep8] -deps = pep8 commands = pep8 --repeat --show-source --ignore=E501 --exclude=.venv,.tox,dist,doc lesscpy setup.py [testenv:flake8]