pinard/Pymacs

Set Python interpreter in Makefile via environment variable

holmboe opened this issue · 4 comments

I looked through the README to find out how I would go about installing Pymacs for Python 3, but couldn't find anything there. So I had a look through the Makefile and it had a PYTHON variable, so I thought fine. Then I thought that the pppp command probably does some fancy things regarding which version should be used so I had a look through ppppconfig.py and right there it was, a way to set the PYTHON environment variable.

So my suggestion is to allow the Makefile to read settings from the environment.

$ diff -uw Makefile.orig Makefile
--- Makefile.orig   2011-12-27 00:34:08.000000000 +0100
+++ Makefile    2011-12-27 00:27:18.000000000 +0100
@@ -3,7 +3,7 @@
 # François Pinard <pinard@iro.umontreal.ca>, 2001.

 EMACS = emacs
-PYTHON = python
+PYTHON ?= python
 RST2LATEX = rst2latex

 PYSETUP = $(PYTHON) setup.py

holmboe writes:

Is "holmboe" your name? Your email did not have a signature.

I looked through the README to find out how I would go about
installing Pymacs for Python 3, but couldn't find anything there.

Oh, the best place to look is the installation chapter in the Pymacs
manual. I thought people would spontaneously go there, but maybe I
should add a note to the README file.

So my suggestion is to allow the Makefile to read settings from the
environment.

I think explicit is better, like for currently:

make PYTHON=python3 install

But if you have strong reasons to disagree, do not hesitate to write
again if you feel like discussing them.

+PYTHON ?= python

I'm unaware of this "?=" construct. I should go read a bit! :-)

Keep happy.

François

I was unaware (or ignorant) that variables could also be set as an argument to make. It makes perfect sense now.

Though, I have always set them through the environment myself. In any case, if you use ?= then it will not matter if you pass PYTHON via a command line argument to make or via the environment. Other than that, I won't argue that setting it through the environment is better.

pinard@iro.umontreal.ca (François Pinard) writes:

[...] maybe I should add a note to the README file.

Oh, the note is already there:

"The Pymacs manual (either in HTML format__ or PDF format__ for the
latest version) has installation instructions [...]"

I'm unaware of this "?=" construct. I should go read a bit! :-)

OK, found it. I would presume it is specific to GNU Make, however.

François

holmboe
reply@reply.github.com
writes:

In any case, if you use ?= then it will not matter if you pass PYTHON
via a command line argument to make or via the environment. Other than
that, I won't argue that setting it through the environment is better.

The documentation already says that "python" is the default for
"PYTHON", when not specified. I would prefer not changing it, as it
might break (a bit gratuitously) the recipes some users might have
developed.

I presume it is not a big deal for you, using the command line argument
to specify how PYTHON would be set. This is only at installation time,
something you probably do not do often, the burden stays small.

François.