diff mbox series

[2/3] Switch to python3 by default

Message ID 20190220160446.23150-3-plautrba@redhat.com (mailing list archive)
State Accepted
Headers show
Series [1/3] Always use /usr/bin/python3 in Python scripts | expand

Commit Message

Petr Lautrbach Feb. 20, 2019, 4:04 p.m. UTC
- Python 2.7 is planned to be the last of the 2.x releases
- It's generally advised to use Python 3
- Majority of python/ scripts are already switched python3
- Users with python 2 only can still use:

$ make PYTHON=/usr/bin/python ....

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 libselinux/src/Makefile               | 2 +-
 libsemanage/src/Makefile              | 2 +-
 python/audit2allow/Makefile           | 2 +-
 python/semanage/Makefile              | 2 +-
 python/sepolgen/src/sepolgen/Makefile | 2 +-
 python/sepolgen/tests/Makefile        | 2 +-
 python/sepolicy/Makefile              | 2 +-
 sandbox/Makefile                      | 2 +-
 scripts/env_use_destdir               | 2 +-
 scripts/run-scan-build                | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 92e30738..e9ed0383 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -1,7 +1,7 @@ 
 # Support building the Python bindings multiple times, against various Python
 # runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build
 # targets with "PYPREFIX":
-PYTHON ?= python
+PYTHON ?= python3
 PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])')
 RUBY ?= ruby
 RUBYPREFIX ?= $(notdir $(RUBY))
diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
index dea751e5..e029f098 100644
--- a/libsemanage/src/Makefile
+++ b/libsemanage/src/Makefile
@@ -1,7 +1,7 @@ 
 # Support building the Python bindings multiple times, against various Python
 # runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build
 # targets with "PYPREFIX":
-PYTHON ?= python
+PYTHON ?= python3
 PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])')
 RUBY ?= ruby
 RUBYPREFIX ?= $(notdir $(RUBY))
diff --git a/python/audit2allow/Makefile b/python/audit2allow/Makefile
index 18d740d3..15db5490 100644
--- a/python/audit2allow/Makefile
+++ b/python/audit2allow/Makefile
@@ -1,4 +1,4 @@ 
-PYTHON ?= python
+PYTHON ?= python3
 SECILC ?= secilc
 
 # Installation directories.
diff --git a/python/semanage/Makefile b/python/semanage/Makefile
index 37065268..024e9640 100644
--- a/python/semanage/Makefile
+++ b/python/semanage/Makefile
@@ -1,4 +1,4 @@ 
-PYTHON ?= python
+PYTHON ?= python3
 
 # Installation directories.
 LINGUAS ?= ru
diff --git a/python/sepolgen/src/sepolgen/Makefile b/python/sepolgen/src/sepolgen/Makefile
index c75809ad..cac8def7 100644
--- a/python/sepolgen/src/sepolgen/Makefile
+++ b/python/sepolgen/src/sepolgen/Makefile
@@ -1,5 +1,5 @@ 
 PREFIX ?= /usr
-PYTHON ?= python
+PYTHON ?= python3
 PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(prefix='$(PREFIX)'))")
 PACKAGEDIR ?= /$(PYTHONLIBDIR)/sepolgen
 
diff --git a/python/sepolgen/tests/Makefile b/python/sepolgen/tests/Makefile
index e17eef22..83d072f4 100644
--- a/python/sepolgen/tests/Makefile
+++ b/python/sepolgen/tests/Makefile
@@ -1,4 +1,4 @@ 
-PYTHON ?= python
+PYTHON ?= python3
 
 clean:
 	rm -f *~ *.pyc
diff --git a/python/sepolicy/Makefile b/python/sepolicy/Makefile
index 7ed039bc..69f29fa9 100644
--- a/python/sepolicy/Makefile
+++ b/python/sepolicy/Makefile
@@ -1,4 +1,4 @@ 
-PYTHON ?= python
+PYTHON ?= python3
 
 # Installation directories.
 LINGUAS ?= ru
diff --git a/sandbox/Makefile b/sandbox/Makefile
index 862bffbe..9da5e58d 100644
--- a/sandbox/Makefile
+++ b/sandbox/Makefile
@@ -1,4 +1,4 @@ 
-PYTHON ?= python
+PYTHON ?= python3
 
 # Installation directories.
 LINGUAS ?= ru
diff --git a/scripts/env_use_destdir b/scripts/env_use_destdir
index 4fbfb8de..251987c2 100755
--- a/scripts/env_use_destdir
+++ b/scripts/env_use_destdir
@@ -25,7 +25,7 @@  export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
 export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
 
 # shellcheck disable=SC2155
-export PYTHONPATH="$DESTDIR$(${PYTHON:-python} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
+export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
 
 # shellcheck disable=SC2155
 export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')"
diff --git a/scripts/run-scan-build b/scripts/run-scan-build
index 8b24a4d0..88fe551c 100755
--- a/scripts/run-scan-build
+++ b/scripts/run-scan-build
@@ -17,7 +17,7 @@  fi
 # Make sure to use the newly-installed libraries when running tests
 export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
 export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
-export PYTHONPATH="$DESTDIR$(${PYTHON:-python} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
+export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
 export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')"
 
 # Build and analyze