Merge lp:~maxiberta/django-openid-auth/pip-upgrade-in-tests into lp:django-openid-auth

Proposed by Maximiliano Bertacchini
Status: Merged
Approved by: Maximiliano Bertacchini
Approved revision: 131
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~maxiberta/django-openid-auth/pip-upgrade-in-tests
Merge into: lp:django-openid-auth
Diff against target: 119 lines (+54/-42)
1 file modified
tox.ini (+54/-42)
To merge this branch: bzr merge lp:~maxiberta/django-openid-auth/pip-upgrade-in-tests
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+353735@code.launchpad.net

Commit message

Upgrade pip before running tests to prevent issues with proxy (tox only).

Description of the change

Old versions of pip (such as the one in Trusty) are unable to download more than 12 dependencies via proxy due to a bug in requests/urllib3.

This fix only affects the pip version used by tox.

Technical details: https://github.com/pypa/pip/issues/1805#issuecomment-70536334
Identical issue in SSO charm: https://code.launchpad.net/~roadmr/canonical-is-charms/canonical-identity-provider-flake8whyyy/+merge/346776

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

LGTM

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
131. By Maximiliano Bertacchini

Explicit tox config to upgrade pip before running tests.

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Updated tox config to make it more explicit.

Pip needs to be updated *before* installing any deps, thus tox's `deps` cannot be used.
Pip cannot be upgraded with a custom `install_command`, as tox 1.6.0 in Trusty supports very limited customization (improved in tox 1.7.0 - issue #128).
OTOH, multidimensional configuration could help with `command` deduplication, but it was introduced in tox 1.8.0.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tox.ini'
2--- tox.ini 2018-03-15 17:54:12 +0000
3+++ tox.ini 2018-08-27 14:32:35 +0000
4@@ -1,61 +1,73 @@
5+# Pip upgrade in the tox venv is needed due to
6+# https://github.com/pypa/pip/issues/1805 which started happening
7+# consistently after April 2018 due to
8+# https://packaging.python.org/guides/migrating-to-pypi-org/.
9+#
10+# Pip needs to be updated before installing any deps, thus tox's `deps`
11+# cannot be used.
12+# Pip cannot be upgraded with a custom `install_command`, as tox 1.6.0 in Trusty
13+# supports very limited customization (improved in tox 1.7.0 - issue #128).
14+# OTOH, multidimensional configuration could help with `command` deduplication,
15+# but it was introduced in tox 1.8.0.
16+
17 [tox]
18 envlist =
19 py27-django1.6,py27-django1.7,py27-django1.8,py27-django1.9,py27-django1.10,py27-django1.11,py3-django1.10,py3-django1.11
20-
21-[testenv]
22-commands = python manage.py test django_openid_auth
23-deps =
24- mock
25-
26-[testenv:py27]
27-basepython = python2.7
28-deps =
29- python-openid
30- {[testenv]deps}
31-
32-[testenv:py3]
33-basepython = python3
34-deps =
35- python3-openid
36- {[testenv]deps}
37+# sdist crashes without `deps`.
38+skipsdist = true
39
40 [testenv:py27-django1.6]
41-deps =
42- django == 1.6.11
43- south
44- {[testenv:py27]deps}
45+basepython = python2.7
46+commands =
47+ pip install --upgrade pip
48+ pip install south mock python-openid django==1.6.11
49+ python manage.py test django_openid_auth
50
51 [testenv:py27-django1.7]
52-deps =
53- django == 1.7.11
54- {[testenv:py27]deps}
55+basepython = python2.7
56+commands =
57+ pip install --upgrade pip
58+ pip install south mock python-openid django==1.7.11
59+ python manage.py test django_openid_auth
60
61 [testenv:py27-django1.8]
62-deps =
63- django == 1.8.17
64- {[testenv:py27]deps}
65+basepython = python2.7
66+commands =
67+ pip install --upgrade pip
68+ pip install south mock python-openid django==1.8.17
69+ python manage.py test django_openid_auth
70
71 [testenv:py27-django1.9]
72-deps =
73- django == 1.9.12
74- {[testenv:py27]deps}
75+basepython = python2.7
76+commands =
77+ pip install --upgrade pip
78+ pip install south mock python-openid django==1.9.12
79+ python manage.py test django_openid_auth
80
81 [testenv:py27-django1.10]
82-deps =
83- django == 1.10.6
84- {[testenv:py27]deps}
85+basepython = python2.7
86+commands =
87+ pip install --upgrade pip
88+ pip install south mock python-openid django==1.10.6
89+ python manage.py test django_openid_auth
90
91 [testenv:py27-django1.11]
92-deps =
93- django == 1.11.11
94- {[testenv:py27]deps}
95+basepython = python2.7
96+commands =
97+ pip install --upgrade pip
98+ pip install south mock python-openid django==1.11.11
99+ python manage.py test django_openid_auth
100
101 [testenv:py3-django1.10]
102-deps =
103- django == 1.10.6
104- {[testenv:py3]deps}
105+basepython = python3
106+commands =
107+ pip install --upgrade pip
108+ pip install south mock python3-openid django==1.10.6
109+ python manage.py test django_openid_auth
110
111 [testenv:py3-django1.11]
112-deps =
113- django == 1.11.11
114- {[testenv:py3]deps}
115+basepython = python3
116+commands =
117+ pip install --upgrade pip
118+ pip install south mock python3-openid django==1.11.11
119+ python manage.py test django_openid_auth

Subscribers

People subscribed via source and target branches