Skip to content

Commit b4981da

Browse files
committed
Merge pull request #1173 from dstufft/use-tox
Configure Tox and Use It to Drive Travis
2 parents fe3d37b + eae5ffc commit b4981da

File tree

6 files changed

+52
-29
lines changed

6 files changed

+52
-29
lines changed

.travis.yml

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
language: python
2-
python:
3-
- 2.6
4-
- 2.7
5-
- 3.2
6-
- 3.3
7-
- pypy
8-
before_install:
9-
- sudo apt-get install subversion bzr mercurial
10-
- echo -e "[web]\ncacerts = /etc/ssl/certs/ca-certificates.crt" >> ~/.hgrc
11-
- git config --global user.email "[email protected]"
12-
- git config --global user.name "Pip"
2+
3+
env:
4+
- TOXENV=collect
5+
- TOXENV=docs
6+
- TOXENV=py26
7+
- TOXENV=py27
8+
- TOXENV=py32
9+
- TOXENV=py33
10+
- TOXENV=pypy
11+
1312
install:
14-
- pip install --upgrade setuptools
15-
- pip install pytest pytest-xdist git+https://github.com/pypa/virtualenv@develop#egg=virtualenv scripttest>=1.3 mock
16-
script:
17-
- "if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then py.test -v; fi"
18-
- "if [[ $TRAVIS_PYTHON_VERSION != '3.2' ]]; then py.test -v -n 8; fi"
19-
notifications:
20-
irc: "irc.freenode.org#pip"
13+
- sudo apt-get install subversion bzr mercurial
14+
- echo -e "[web]\ncacerts = /etc/ssl/certs/ca-certificates.crt" >> ~/.hgrc
15+
- git config --global user.email "[email protected]"
16+
- git config --global user.name "Pip"
17+
- pip install tox
18+
19+
script: tox
20+
2121
branches:
2222
only:
2323
- develop
2424
- 1.3.X
2525
- 1.4.X
26-
env:
27-
- PYTHONHASHSEED=0
26+
27+
notifications:
28+
irc: "irc.freenode.org#pip"

docs/development.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ Running tests
2929

3030
OS Requirements: subversion, bazaar, git, and mercurial.
3131

32-
Python Requirements: pytest, virtualenv, scripttest, and mock
32+
Python Requirements: tox or pytest, virtualenv, scripttest, and mock
3333

3434
Ways to run the tests locally:
3535

3636
::
3737

38+
$ tox -e py33 # The preferred way to run the tests, can use pyNN to
39+
# run for a particular version or leave off the -e to
40+
# run for all versions.
3841
$ python setup.py test # Using the setuptools test plugin
3942
$ py.test # Using py.test directly
4043
$ tox # Using tox against pip's tox.ini

docs/logic.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ files without a hash, or files that are linked from either the home page or the
105105
download url of a package.
106106

107107
In order to get the future behavior in v1.4 the ``pip install`` command
108-
supports a :ref:`--no-allow-external <--no-allow-external>` and
109-
:ref:`--no-allow-insecure <--no-allow-external>` flags.
108+
supports a ``--no-allow-external`` and ``--no-allow-insecure`` flags.
110109

111110
.. _`VCS Support`:
112111

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def virtualenv(tmpdir, monkeypatch):
4242
pip_src = tmpdir.join("pip_src").abspath
4343
shutil.copytree(SRC_DIR, pip_src,
4444
ignore=shutil.ignore_patterns(
45-
"*.pyc", "docs/", "tests/", "pip.egg-info",
45+
"*.pyc", "tests", "pip.egg-info", "build", "dist", ".tox",
4646
),
4747
)
4848

tests/lib/venv.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ def _create(self, clear=False):
4848

4949
# Install our development version of pip install the virtual
5050
# environment
51+
cmd = [self.location.join("bin", "python"), "setup.py", "develop"]
5152
p = subprocess.Popen(
52-
[self.location.join("bin", "python"), "setup.py", "develop"],
53+
cmd,
5354
cwd=self.pip_source_dir,
5455
stderr=subprocess.STDOUT,
5556
stdout=DEVNULL,
5657
)
5758
p.communicate()
58-
5959
if p.returncode != 0:
60-
raise subprocess.CalledProcessError(p.returncode, p.args)
60+
raise subprocess.CalledProcessError(p.returncode, cmd[0],
61+
output=p.stdout,
62+
)
6163

6264
def clear(self):
6365
self._create(clear=True)

tox.ini

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
[tox]
22
envlist =
3-
py26,py27,py32,py33,pypy
3+
collect,docs,py26,py27,py32,py33,pypy
44

55
[testenv]
6-
deps=
6+
deps =
77
pytest
8+
pytest-xdist
89
mock
910
scripttest>=1.3
1011
git+https://github.com/pypa/virtualenv@develop#egg=virtualenv
12+
commands =
13+
py.test -n 8
14+
15+
[testenv:collect]
16+
commands =
17+
py.test --collectonly
18+
19+
[testenv:docs]
20+
deps = sphinx
21+
basepython = python2.7
22+
commands =
23+
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
24+
25+
[testenv:py32]
1126
commands =
1227
py.test
1328

29+
[testenv:py33]
30+
setenv =
31+
PYTHONHASHSEED = 0

0 commit comments

Comments
 (0)