Skip to content

Commit dede1f2

Browse files
committed
convert requirements-*.txt to be inclusive; flake8 script introduced
1 parent 1553192 commit dede1f2

8 files changed

+44
-18
lines changed

.travis.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,11 @@ before_install:
2626
- git submodule update --init --recursive
2727

2828
install:
29-
- pip install -r requirements.txt -r requirements-test.txt --use-mirrors
30-
- if [[ $USE_OPTIONAL == "true" ]]; then pip install -r requirements-optional.txt --use-mirrors; fi
31-
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" && $USE_OPTIONAL == "true" ]]; then pip install -r requirements-optional-2.6.txt --use-mirrors; fi
32-
- if [[ $TRAVIS_PYTHON_VERSION != "pypy" && $USE_OPTIONAL == "true" ]]; then pip install -r requirements-optional-cpython.txt --use-mirrors; fi
33-
- if [[ $FLAKE == "true" ]]; then pip install --use-mirrors flake8; fi
29+
- bash requirements-install.sh
3430

3531
script:
3632
- nosetests
37-
- if [[ $FLAKE == "true" ]]; then find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501; fi
38-
- if [[ $FLAKE == "true" ]]; then flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py; fi
33+
- bash flake8-run.sh
3934

4035
after_script:
4136
- python debug-info.py

flake8-run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -e
2+
3+
if [[ ! -x $(which flake8) ]]; then
4+
echo "fatal: flake8 not found on $PATH. Exiting."
5+
exit 1
6+
fi
7+
8+
if [[ $FLAKE == "true" ]]; then
9+
find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501
10+
flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py
11+
fi

requirements-install.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash -e
2+
3+
if [[ $USE_OPTIONAL != "true" && $USE_OPTIONAL != "false" ]]; then
4+
echo "fatal: \$USE_OPTIONAL not set to true or false. Exiting."
5+
exit 1
6+
fi
7+
8+
pip install -r requirements-test.txt --use-mirrors
9+
10+
if [[ $USE_OPTIONAL == "true" && $TRAVIS_PYTHON_VERSION != "pypy" ]]; then
11+
if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then
12+
pip install -r requirements-optional-2.6.txt --use-mirrors
13+
else
14+
pip install -r requirements-optional-cpython.txt --use-mirrors
15+
fi
16+
fi
17+
18+
if [[ $FLAKE == "true" ]]; then
19+
pip install --use-mirrors flake8
20+
fi

requirements-optional-2.6.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-r requirements-optional-cpython.txt
2+
13
# Can be used to force attributes to be serialized in alphabetical
24
# order.
35
ordereddict

requirements-optional-cpython.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-r requirements-optional.txt
2+
13
# lxml is supported with its own treebuilder ("lxml") and otherwise
24
# uses the standard ElementTree support
35
lxml

requirements-optional.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-r requirements.txt
2+
13
# We support a Genshi treewalker that can be used to serialize Genshi
24
# streams.
35
genshi

requirements-test.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
-r requirements.txt
2+
13
nose
24
ordereddict # Python 2.6

tox.ini

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ envlist = py26,py27,py32,py33
33

44
[testenv]
55
deps =
6-
charade
7-
datrie
8-
Genshi
9-
lxml
6+
-r{toxinidir}/requirements-optional-cpython.txt
107
nose
11-
six
128
commands =
139
{envbindir}/nosetests -q
10+
{toxinidir}/flake8-run.sh
1411

1512
[testenv:pypy]
1613
# lxml doesn't work and datrie doesn't make sense
@@ -24,10 +21,5 @@ deps =
2421
[testenv:py26]
2522
basepython = python2.6
2623
deps =
27-
charade
28-
datrie
29-
Genshi
30-
lxml
24+
-r{toxinidir}/requirements-optional-2.6.txt
3125
nose
32-
six
33-
ordereddict

0 commit comments

Comments
 (0)