Skip to content

Commit

Permalink
Switch to python3 by default
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
bachradsusi committed Feb 20, 2019
1 parent 3b868ab commit 1952be6
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 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))
Expand Down
2 changes: 1 addition & 1 deletion 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))
Expand Down
2 changes: 1 addition & 1 deletion python/audit2allow/Makefile
@@ -1,4 +1,4 @@
PYTHON ?= python
PYTHON ?= python3
SECILC ?= secilc

# Installation directories.
Expand Down
2 changes: 1 addition & 1 deletion python/semanage/Makefile
@@ -1,4 +1,4 @@
PYTHON ?= python
PYTHON ?= python3

# Installation directories.
LINGUAS ?= ru
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down
2 changes: 1 addition & 1 deletion python/sepolgen/tests/Makefile
@@ -1,4 +1,4 @@
PYTHON ?= python
PYTHON ?= python3

clean:
rm -f *~ *.pyc
Expand Down
2 changes: 1 addition & 1 deletion python/sepolicy/Makefile
@@ -1,4 +1,4 @@
PYTHON ?= python
PYTHON ?= python3

# Installation directories.
LINGUAS ?= ru
Expand Down
2 changes: 1 addition & 1 deletion sandbox/Makefile
@@ -1,4 +1,4 @@
PYTHON ?= python
PYTHON ?= python3

# Installation directories.
LINGUAS ?= ru
Expand Down
2 changes: 1 addition & 1 deletion scripts/env_use_destdir
Expand Up @@ -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"]')"
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-scan-build
Expand Up @@ -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
Expand Down

0 comments on commit 1952be6

Please sign in to comment.