Default to running tests with Python 3

Specify PY2=1 to use Python 2.

See #1779
Closes #2235
This commit is contained in:
Olly Betts 2022-03-17 15:30:21 +13:00
commit c7af8eabb3
14 changed files with 39 additions and 36 deletions

View file

@ -309,7 +309,7 @@ perl5_clean:
PYTHON_FLAGS =
# Make sure these locate your Python installation
ifeq (,$(PY3))
ifneq (,$(PY2))
PYTHON_INCLUDE= $(DEFS) @PYINCLUDE@
PYTHON_LIB = @PYLIB@
PYTHON = @PYTHON@ $(PYTHON_FLAGS)
@ -320,7 +320,7 @@ else
endif
# Extra Python specific linking options
ifeq (,$(PY3))
ifneq (,$(PY2))
PYTHON_DLNK = @PYTHONDYNAMICLINKING@
PYTHON_LINK = @PYLINK@
else
@ -330,7 +330,7 @@ endif
PYTHON_SO = @PYTHON_SO@
# SWIG option for Python3
ifeq (,$(PY3))
ifneq (,$(PY2))
SWIGOPTPY3 =
else
SWIGOPTPY3 = -py3

View file

@ -1,7 +1,7 @@
TOP = ../../..
LIBS =
ifeq (,$(PY3))
ifneq (,$(PY2))
PKG1DIR = "py2"
else
PKG1DIR = "py3"

View file

@ -1,7 +1,7 @@
TOP = ../../..
LIBS =
ifeq (,$(PY3))
ifneq (,$(PY2))
PKG1DIR = "py2"
else
PKG1DIR = "py3"

View file

@ -1,7 +1,7 @@
TOP = ../../..
LIBS =
ifeq (,$(PY3))
ifneq (,$(PY2))
PKG1DIR = "py2"
else
PKG1DIR = "py3"

View file

@ -1,7 +1,7 @@
TOP = ../../..
LIBS =
ifeq (,$(PY3))
ifneq (,$(PY2))
PKG1DIR = "py2"
else
PKG1DIR = "py3"

View file

@ -1,7 +1,7 @@
TOP = ../../..
LIBS =
ifeq (,$(PY3))
ifneq (,$(PY2))
PKG1DIR = "py2"
else
PKG1DIR = "py3"

View file

@ -1,7 +1,7 @@
TOP = ../../..
LIBS =
ifeq (,$(PY3))
ifneq (,$(PY2))
PKG1DIR = "py2"
else
PKG1DIR = "py3"

View file

@ -88,7 +88,7 @@ to look at the <a href="http://www.python.org/sigs/distutils-sig/">distutils</a>
<h2>Compatibility</h2>
For Python 3, set the environment variable <tt>PY3=1</tt>.
For Python 2, set the environment variable <tt>PY2=1</tt>.
<p>
Your mileage may vary. If you experience a problem, please let us know by

View file

@ -2,7 +2,7 @@
# Makefile for python test-suite
#######################################################################
ifeq (,$(PY3))
ifneq (,$(PY2))
PYBIN = @PYTHON@
else
PYBIN = @PYTHON3@

View file

@ -4,5 +4,6 @@ Any testcases which have _runme.py appended after the testcase name will be dete
The _runme.py files needs to work for both Python 2.x and 3.x.
You can run make with PY3=y to run test case with Python 3.x, eg.
$ make voidtest.cpptest PY3=y
By default testcases are run with Python 3. You can run make with PY2=1 to run test case with Python 2, eg.
$ make voidtest.cpptest PY2=1