From 54f03dfd8e9de10ccc55c7463002c67cf7c0d391 Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Sun, 19 Feb 2017 23:08:27 +0000 Subject: [PATCH 1/6] Declare min/max versions of all our dependencies --- requirements-optional.txt | 8 ++++---- requirements-test.txt | 8 +++++--- requirements.txt | 6 +++--- setup.py | 18 +++++++++--------- tox.ini | 14 ++++++++------ 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/requirements-optional.txt b/requirements-optional.txt index c00fd242..518360b5 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -2,16 +2,16 @@ # We support a Genshi treewalker that can be used to serialize Genshi # streams. -genshi +genshi>=0.7,<2.0 # chardet can be used as a fallback in case we are unable to determine # the encoding of a document. -chardet>=2.2 +chardet>=2.2.1,<3.0 # lxml is supported with its own treebuilder ("lxml") and otherwise # uses the standard ElementTree support -lxml ; platform_python_implementation == 'CPython' +lxml>=2.3,<4.0 ; platform_python_implementation == 'CPython' # DATrie can be used in place of our Python trie implementation for # slightly better parsing performance. -datrie ; platform_python_implementation == 'CPython' +datrie>=0.5,<2.0 ; platform_python_implementation == 'CPython' diff --git a/requirements-test.txt b/requirements-test.txt index 40df78d4..bf73bed6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,8 @@ -r requirements.txt -flake8<3.0 -pytest +flake8==2.6.2 +pycodestyle==2.0.0 +pyflakes==1.2.3 +pytest>=2.7,<4.0 pytest-expect>=1.1,<2.0 -mock +mock>=0.7,<3.0 diff --git a/requirements.txt b/requirements.txt index 3884556f..ce36b1d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -six>=1.9 -webencodings -ordereddict ; python_version < '2.7' +six>=1.9,<2.0 +webencodings>=0.5,<0.6 +ordereddict>=1.1,<2.0 ; python_version < '2.7' diff --git a/setup.py b/setup.py index 6f0fc17e..446b008e 100644 --- a/setup.py +++ b/setup.py @@ -102,28 +102,28 @@ def default_environment(): maintainer_email='james@hoppipolla.co.uk', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), install_requires=[ - 'six>=1.9', - 'webencodings', + 'six>=1.9,<2.0', + 'webencodings>=0.5,<0.6', ], extras_require={ # A empty extra that only has a conditional marker will be # unconditonally installed when the condition matches. - ":python_version == '2.6'": ["ordereddict"], + ":python_version == '2.6'": ["ordereddict>=1.1,<2.0"], # A conditional extra will only install these items when the extra is # requested and the condition matches. - "datrie:platform_python_implementation == 'CPython'": ["datrie"], - "lxml:platform_python_implementation == 'CPython'": ["lxml"], + "datrie:platform_python_implementation == 'CPython'": ["datrie>=0.5,<2.0"], + "lxml:platform_python_implementation == 'CPython'": ["lxml>=2.3,<4.0"], # Standard extras, will be installed when the extra is requested. - "genshi": ["genshi"], - "chardet": ["chardet>=2.2"], + "genshi": ["genshi>=0.7,<2.0"], + "chardet": ["chardet>=2.2.1,<3.0"], # The all extra combines a standard extra which will be used anytime # the all extra is requested, and it extends it with a conditional # extra that will be installed whenever the condition matches and the # all extra is requested. - "all": ["genshi", "chardet>=2.2"], - "all:platform_python_implementation == 'CPython'": ["datrie", "lxml"], + "all": ["genshi>=0.7,<2.0", "chardet>=2.2,<3.0"], + "all:platform_python_implementation == 'CPython'": ["datrie>=0.5,<2.0", "lxml>=2.3,<4.0"], }, ) diff --git a/tox.ini b/tox.ini index da64de71..52ff845e 100644 --- a/tox.ini +++ b/tox.ini @@ -3,13 +3,15 @@ envlist = {py26,py27,py33,py34,py35,pypy}-{base,optional} [testenv] deps = - flake8<3.0 - pytest + flake8==2.6.2 + pycodestyle==2.0.0 + pyflakes==1.2.3 + pytest>=2.7,<4.0 pytest-expect>=1.1,<2.0 - mock - base: six - base: webencodings - py26-base: ordereddict + mock>=0.7,<3.0 + base: six>=1.9,<2.0 + base: webencodings>=0.5,<0.6 + py26-base: ordereddict>=1.1,<2.0 optional: -r{toxinidir}/requirements-optional.txt commands = From 7bfff4888905b2924bdd7599e530c6ee90965673 Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Sun, 19 Feb 2017 23:19:26 +0000 Subject: [PATCH 2/6] Test on min versions of all deps, not just six --- .travis.yml | 2 +- requirements-install.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5ffd833..7e54f8ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ cache: env: - USE_OPTIONAL=true - USE_OPTIONAL=false - - SIX_VERSION=1.9 USE_OPTIONAL=true + - DEP_VERSION=min USE_OPTIONAL=true install: - ./requirements-install.sh diff --git a/requirements-install.sh b/requirements-install.sh index 7ba9396f..f822dc88 100755 --- a/requirements-install.sh +++ b/requirements-install.sh @@ -2,16 +2,16 @@ pip install pip==6.1.0 +if [[ $DEP_VERSION == "min" ]]; then + sed -i'' -e 's/>=/==/g' requirements*.txt +fi + pip install -U -r requirements-test.txt if [[ $USE_OPTIONAL == "true" ]]; then pip install -U -r requirements-optional.txt fi -if [[ $SIX_VERSION ]]; then - pip install six==$SIX_VERSION -fi - if [[ $CI == "true" ]]; then - pip install -U codecov + pip install codecov fi From ee92ee264aee239c7ac1456bdd4723f139a545a0 Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Sun, 19 Feb 2017 23:20:16 +0000 Subject: [PATCH 3/6] Add Python 3.6 to the test matrix --- .travis.yml | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e54f8ca..bf9e3ceb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ python: - "3.3" - "3.4" - "3.5" + - "3.6" - "pypy" sudo: false diff --git a/tox.ini b/tox.ini index 52ff845e..bfc0d447 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = {py26,py27,py33,py34,py35,pypy}-{base,optional} +envlist = {py26,py27,py33,py34,py35,py36,pypy}-{base,optional} [testenv] deps = From 7df5bd381a279461c7350cd94a0d8dd05d2fc61f Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Mon, 20 Feb 2017 22:47:51 +0000 Subject: [PATCH 4/6] fixup! Test on min versions of all deps, not just six --- .travis.yml | 7 +++++++ requirements-install.sh | 6 +++++- requirements-test.txt | 2 +- tox.ini | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf9e3ceb..094635f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,13 @@ env: - USE_OPTIONAL=false - DEP_VERSION=min USE_OPTIONAL=true +matrix: + include: + - python: "2.6" + env: PIP_VERSION=6.1.0 DEP_VERSION=min USE_OPTIONAL=true + - python: "3.3" + env: PIP_VERSION=6.1.0 DEP_VERSION=min USE_OPTIONAL=true + install: - ./requirements-install.sh diff --git a/requirements-install.sh b/requirements-install.sh index f822dc88..fd492375 100755 --- a/requirements-install.sh +++ b/requirements-install.sh @@ -1,6 +1,10 @@ #!/bin/bash -ex -pip install pip==6.1.0 +if [[ $PIP_VERSION ]]; then + pip install "pip==$PIP_VERSION" +else + pip install -U pip setuptools wheel +fi if [[ $DEP_VERSION == "min" ]]; then sed -i'' -e 's/>=/==/g' requirements*.txt diff --git a/requirements-test.txt b/requirements-test.txt index bf73bed6..851e41b4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,6 +3,6 @@ flake8==2.6.2 pycodestyle==2.0.0 pyflakes==1.2.3 -pytest>=2.7,<4.0 +pytest>=2.7.3,<4.0 pytest-expect>=1.1,<2.0 mock>=0.7,<3.0 diff --git a/tox.ini b/tox.ini index bfc0d447..06f68a25 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ deps = flake8==2.6.2 pycodestyle==2.0.0 pyflakes==1.2.3 - pytest>=2.7,<4.0 + pytest>=2.7.3,<4.0 pytest-expect>=1.1,<2.0 mock>=0.7,<3.0 base: six>=1.9,<2.0 From 45863e2a004b247e67c421b99dfae4dcfee2ac4f Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Tue, 21 Feb 2017 00:50:47 +0000 Subject: [PATCH 5/6] fixup! Test on min versions of all deps, not just six --- requirements-install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements-install.sh b/requirements-install.sh index fd492375..eef485ba 100755 --- a/requirements-install.sh +++ b/requirements-install.sh @@ -3,7 +3,9 @@ if [[ $PIP_VERSION ]]; then pip install "pip==$PIP_VERSION" else - pip install -U pip setuptools wheel + # Upgrade pip first because the ancient Travis version is b0rked + pip install -U pip + pip install -U setuptools wheel fi if [[ $DEP_VERSION == "min" ]]; then From 8d18acf2a211d0c663a582b366da7e8d12ec0c8d Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Tue, 21 Feb 2017 00:56:09 +0000 Subject: [PATCH 6/6] fixup! Test on min versions of all deps, not just six --- requirements-install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/requirements-install.sh b/requirements-install.sh index eef485ba..59339db0 100755 --- a/requirements-install.sh +++ b/requirements-install.sh @@ -3,9 +3,7 @@ if [[ $PIP_VERSION ]]; then pip install "pip==$PIP_VERSION" else - # Upgrade pip first because the ancient Travis version is b0rked pip install -U pip - pip install -U setuptools wheel fi if [[ $DEP_VERSION == "min" ]]; then