Skip to content

Commit b553753

Browse files
committed
RF: more consistent use of PYTHON var in Makefiles
Use PYTHON environment variable to select Python binary.
1 parent c38bd26 commit b553753

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Automating common tasks for NIPY development
22

3-
PYTHON = python
3+
PYTHON ?= python
44
HTML_DIR = doc/build/html
55
LATEX_DIR = doc/build/latex
66
WWW_DIR = doc/dist
@@ -80,16 +80,16 @@ bdist-egg-tests:
8080
$(PYTHON) -c 'from nisext.testers import bdist_egg_tests; bdist_egg_tests("nipy")'
8181

8282
source-release: distclean
83-
python -m compileall .
83+
$(PYTHON) -m compileall .
8484
make distclean
85-
python setup.py sdist --formats=gztar,zip
85+
$(PYTHON) setup.py sdist --formats=gztar,zip
8686

8787
venv-tests:
8888
# I use this for python2.5 because the sdist-tests target doesn't work
8989
# (the tester routine uses a 2.6 feature)
9090
make distclean
9191
- rm -rf $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nipy
92-
python setup.py install
92+
$(PYTHON) setup.py install
9393
cd .. && nosetests $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nipy
9494

9595
tox-fresh:

doc/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Makefile for Sphinx documentation
22
#
33

4+
PYTHON ?= python
45
DIST_DIR = dist
56

67
# You can set these variables from the command line.
@@ -58,15 +59,15 @@ htmlonly:
5859
@echo "Build finished. The HTML pages are in build/html."
5960

6061
api:
61-
python ../tools/build_modref_templates.py
62+
$(PYTHON) ../tools/build_modref_templates.py
6263
@echo "Build API docs finished."
6364

6465
html: api htmlonly
6566
-ln -s build manual
6667
@echo "Build HTML and API finished."
6768

6869
gitwash-update:
69-
python ../tools/gitwash_dumper.py devel/guidelines nipy \
70+
$(PYTHON) ../tools/gitwash_dumper.py devel/guidelines nipy \
7071
--github-user=nipy \
7172
--project-url=http://nipy.org/nipy \
7273
--project-ml-url=https://mail.python.org/mailman/listinfo/neuroimaging
@@ -90,7 +91,7 @@ latex: api
9091
mkdir -p build/latex build/doctrees
9192
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
9293
# Clear bug for longtable column output in sphinx
93-
python ../tools/fix_longtable.py build/latex/nipy.tex
94+
$(PYTHON) ../tools/fix_longtable.py build/latex/nipy.tex
9495
@echo
9596
@echo "Build finished; the LaTeX files are in build/latex."
9697
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \

0 commit comments

Comments
 (0)