git » libfiu » commit dd89edd

Deprecate Python 2 usage

author Alberto Bertogli
2021-04-19 21:04:35 UTC
committer Alberto Bertogli
2021-04-19 22:07:18 UTC
parent 590a7df3e8f18a164ab45c2db8aa835980649b33

Deprecate Python 2 usage

Python 2 is end-of-life.

We don't use Python 2 for building or testing, but currently have Python
2 bindings that get built with "make all" and "make test".

This patch removes the Python 2 make target dependency, so Python 2
bindings won't get automatically built anymore.

Manual builds continue to be supported (for now) with "make python2" and
friends, but are likely to be removed in the future.

Makefile +4 -4
tests/wrap-python +1 -4

diff --git a/Makefile b/Makefile
index cd4e81c..4384b3b 100644
--- a/Makefile
+++ b/Makefile
@@ -61,17 +61,17 @@ test_clean:
 	$(MAKE) -C tests clean
 
 
-bindings: python2 python3
+bindings: python3
 
-bindings_install: python2_install python3_install
+bindings_install: python3_install
 
 bindings_clean: python_clean
 
 python2: libfiu
-	cd bindings/python && python setup.py build
+	cd bindings/python && python2 setup.py build
 
 python2_install: python2
-	cd bindings/python && python setup.py install
+	cd bindings/python && python2 setup.py install
 
 python3: libfiu
 	cd bindings/python && python3 setup.py build
diff --git a/tests/wrap-python b/tests/wrap-python
index f35e334..3ae833d 100755
--- a/tests/wrap-python
+++ b/tests/wrap-python
@@ -54,10 +54,7 @@ mod_path = os.path.dirname(os.path.abspath(mod_bins[0]))
 os.environ["PYTHONPATH"] = ":".join([mod_path,
 					os.environ.get("PYTHONPATH", "")])
 
-if py_ver == '2':
-	py_bin = "python"
-else:
-	py_bin = "python3"
+py_bin = "python" + py_ver
 
 if verbose:
     print("LD_LIBRARY_PATH=%s" % os.environ["LD_LIBRARY_PATH"],