Add test-requirements.txt
The central place for all testing requirements. And use it everywhere.
This commit is contained in:
parent
268d1d78e3
commit
3cd83f18fe
@ -3,7 +3,5 @@ python:
|
|||||||
# - "2.6"
|
# - "2.6"
|
||||||
- "2.7"
|
- "2.7"
|
||||||
- "3.3"
|
- "3.3"
|
||||||
# command to install dependencies
|
install: "pip install --use-mirrors -r test-requirements.txt"
|
||||||
install: "pip install -r requirements.txt --use-mirrors"
|
|
||||||
# command to run tests
|
|
||||||
script: python test/__main__.py -v
|
script: python test/__main__.py -v
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
include LICENSE
|
include LICENSE
|
||||||
include README.rst
|
include README.rst
|
||||||
include requirements.txt
|
include requirements.txt test-requirements.txt
|
||||||
include tox.ini
|
include tox.ini
|
||||||
recursive-include test *
|
recursive-include test *
|
||||||
|
9
setup.py
9
setup.py
@ -14,7 +14,12 @@ with codecs.open('README.rst', encoding='utf-8') as f:
|
|||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = [str(req) for req in pkg_resources.parse_requirements(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(
|
setup(
|
||||||
name='lesscpy',
|
name='lesscpy',
|
||||||
@ -28,6 +33,8 @@ setup(
|
|||||||
packages=find_packages(exclude=['*test*']),
|
packages=find_packages(exclude=['*test*']),
|
||||||
scripts=['bin/lesscpy'],
|
scripts=['bin/lesscpy'],
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
|
tests_require=test_requires,
|
||||||
|
test_suite='test',
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
|
3
test-requirements.txt
Normal file
3
test-requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
-r requirements.txt
|
||||||
|
pep8==1.4.6
|
||||||
|
flake8
|
3
tox.ini
3
tox.ini
@ -2,11 +2,10 @@
|
|||||||
envlist = py26,py27,py33,pep8
|
envlist = py26,py27,py33,pep8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
commands = python test/__main__.py -v
|
commands = python test/__main__.py -v
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = pep8
|
|
||||||
commands = pep8 --repeat --show-source --ignore=E501 --exclude=.venv,.tox,dist,doc lesscpy setup.py
|
commands = pep8 --repeat --show-source --ignore=E501 --exclude=.venv,.tox,dist,doc lesscpy setup.py
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user