Patchwork D10251: makefile: use Python 3 by default when building docs as well

login
register
mail settings
Submitter phabricator
Date March 22, 2021, 10:35 p.m.
Message ID <differential-rev-PHID-DREV-fadmwss5yd64jn4jqfp5-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48567/
State Superseded
Headers show

Comments

phabricator - March 22, 2021, 10:35 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I copied the snippet defining `PYTHON` from the root Makefile.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10251

AFFECTED FILES
  doc/Makefile

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/doc/Makefile b/doc/Makefile
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -6,7 +6,14 @@ 
 PREFIX=/usr/local
 MANDIR=$(PREFIX)/share/man
 INSTALL=install -m 644
-PYTHON?=python
+# Default to Python 3.
+#
+# Windows ships Python 3 as `python.exe`, which may not be on PATH.  py.exe is.
+ifeq ($(OS),Windows_NT)
+PYTHON?=py -3
+else
+PYTHON?=python3
+endif
 RSTARGS=
 
 export HGENCODING=UTF-8