Skip to content

Commit 479dd9c

Browse files
committed
NF - tox configuration, with some docs and Makefile targets
1 parent 2dc71e4 commit 479dd9c

File tree

3 files changed

+57
-22
lines changed

3 files changed

+57
-22
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,15 @@ venv-tests:
258258
python setup.py install
259259
cd .. && nosetests $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nibabel
260260

261+
tox-fresh:
262+
# tox tests with fresh-installed virtualenvs. Needs network. And
263+
# pytox, obviously.
264+
tox -c tox.ini
265+
266+
tox-stale:
267+
# tox tests with MB's already-installed virtualenvs (numpy and nose
268+
# installed)
269+
tox -e python25,python26,python27,python32,np-1.2.1
270+
261271
.PHONY: orig-src pylint
262272

doc/source/devel/make_release.rst

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,43 @@ Release checklist
9292
{'sys_version': '2.6.6 (r266:84374, Aug 31 2010, 11:00:51) \n[GCC 4.0.1 (Apple Inc. build 5493)]', 'commit_source': 'repository', 'np_version': '1.5.0', 'commit_hash': '25b4125', 'pkg_path': '/Users/mb312/dev_trees/nibabel/nibabel', 'sys_executable': '/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python', 'sys_platform': 'darwin'}
9393

9494
* You probably have virtualenvs for different python versions. Check the tests
95-
pass for different configurations. Here's what that looks like for my
96-
virtualenv / virtualenvwrapper setup::
95+
pass for different configurations. If you have pytox_ and a network
96+
connnection, and lots of pythons installed, you might be able to do::
97+
98+
tox
99+
100+
and get tests for python 2.5, 2.6, 2.7, 3.2. I (MB) have my own set of
101+
virtualenvs installed and I've set them up to run with::
102+
103+
tox -e python25,python26,python27,python32,np-1.2.1
104+
105+
The trick was only to define these ``testenv`` sections in ``tox.ini``.
106+
107+
These two above run with::
108+
109+
make tox-fresh
110+
make tox-stale
111+
112+
respectively.
113+
114+
The long-hand not-tox way looks like this::
97115

98-
workon python25
99-
make venv-tests # can't use sdist-tests for python 2.5
100-
deactivate
101116
workon python26
102117
make sdist-tests
103118
deactivate
104-
workon python27
105-
make sdist-tests
106-
deactivate
107-
workon python3.2
108-
make sdist-tests
109-
deactivate
110-
workon np-1.2.1
111-
make venv-tests # python 2.5 again
112-
deactivate
119+
120+
etc for the different virtualenvs.
113121

114122
* Check on different platforms, particularly windows and PPC. I have wine
115-
installed on my Mac, and git bash installed under wine. I run these via a
116-
custom script thus::
123+
installed on my Mac, and git bash installed under wine. I run bash and the
124+
tests like this::
117125

118-
winebash
126+
wineconsole bash
119127
# in wine bash
120128
make sdist-tests
121129

122130
For the PPC I have to log into an old Mac G5 in Berkeley. It doesn't have a
123-
fixed IP even, but here's an example::
131+
fixed IP even, but here's an example session::
124132

125133
ssh 128.32.52.219
126134
cd dev_trees/nibabel
@@ -134,10 +142,6 @@ Release checklist
134142
make doctest
135143
cd ..
136144

137-
At the moment this generates lots of errors from the autodoc documentation
138-
running the doctests in the code, where the doctests pass when run in nose -
139-
we should find out why this is at some point, but leave it for now.
140-
141145
* The release should now be ready.
142146

143147
* Edit :file:`nibabel/info.py` to set ``_version_extra`` to ``''``; commit.
@@ -208,4 +212,5 @@ Release checklist
208212

209213
* Announce to the mailing lists.
210214

215+
.. _pytox: http://codespeak.net/tox
211216
.. _setuptools intro: http://packages.python.org/an_example_pypi_project/setuptools.html

tox.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tox]
2+
# From-scratch tox-default-name virtualenvs
3+
envlist = py25,py26,py27,py32
4+
[testenv]
5+
deps =
6+
nose
7+
numpy
8+
commands=nosetests --with-doctest
9+
# MBs virtualenvs; numpy, nose already installed. Run these with:
10+
# tox -e python25,python26,python27,python32,np-1.2.1
11+
[testenv:python25]
12+
deps =
13+
[testenv:python26]
14+
deps =
15+
[testenv:python27]
16+
deps =
17+
[testenv:python32]
18+
deps =
19+
[testenv:np-1.2.1]
20+
deps =

0 commit comments

Comments
 (0)