From: Matthew Fernandez Date: Thu, 3 Jun 2021 00:20:18 +0000 (-0700) Subject: remove support for Python 2 X-Git-Tag: 2.47.3~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e632785ebda741ae6b394449fc115c2a7c0c7989;p=graphviz remove support for Python 2 Python 2 was EOLed in 2020. This change removes support for building Graphviz bindings for Python 2, as well as build system detection of Python 2. The targets for `python` as distinct from `python3` are left in place for environments for which the former is their name for Python 3. Closes #1992. --- diff --git a/.gitignore b/.gitignore index 4d1e19a69..4748b8b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -132,7 +132,6 @@ tclpkg/gv/gv_ocaml.cpp tclpkg/gv/gv_perl.cpp tclpkg/gv/gv_php.cpp tclpkg/gv/gv_python.cpp -tclpkg/gv/gv_python2.cpp tclpkg/gv/gv_python3.cpp tclpkg/gv/gv_ruby.cpp tclpkg/gv/gv_sharp.cpp diff --git a/CHANGELOG.md b/CHANGELOG.md index 677438781..52ee21eef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - implicit 63 character limit on plugin names is removed in GVC - the packaging work flow on CentOS 7 now selects the Python 3 bindings, instead of Python 2 bindings +- remove Python 2 bindings #1992 ### Fixed diff --git a/ci/centos7/Dockerfile b/ci/centos7/Dockerfile index cba52c3a1..e1d66d2ed 100644 --- a/ci/centos7/Dockerfile +++ b/ci/centos7/Dockerfile @@ -64,8 +64,6 @@ php-devel \ bzip2-devel \ openssl-devel \ libxml2-devel \ -# Language extension gv_python & gv_python2 -python2-devel \ # Language extension gv_python3 python3-devel \ # Language extension gv_ruby diff --git a/ci/centos8/Dockerfile b/ci/centos8/Dockerfile index 9657dc87b..ff48d2be0 100644 --- a/ci/centos8/Dockerfile +++ b/ci/centos8/Dockerfile @@ -54,8 +54,6 @@ perl-ExtUtils-Embed \ php-devel \ openssl-devel \ libxml2-devel \ -# Language extension gv_python & gv_python2 -python2-devel \ # Language extension gv_python3 python3-devel \ # Language extension gv_ruby diff --git a/ci/ubuntu-18.04/Dockerfile b/ci/ubuntu-18.04/Dockerfile index 51b6bebc1..b762f1f8d 100644 --- a/ci/ubuntu-18.04/Dockerfile +++ b/ci/ubuntu-18.04/Dockerfile @@ -70,8 +70,6 @@ libperl-dev \ php-dev \ libsodium-dev \ libargon2-0-dev \ -# Language extension gv_python & gv_python2 -python2.7-dev \ # Language extension gv_python3 libpython3-dev \ # Language extension gv_ruby diff --git a/ci/ubuntu-20.04/Dockerfile b/ci/ubuntu-20.04/Dockerfile index e80dc371b..956d8ebec 100644 --- a/ci/ubuntu-20.04/Dockerfile +++ b/ci/ubuntu-20.04/Dockerfile @@ -70,8 +70,6 @@ libperl-dev \ php-dev \ libsodium-dev \ libargon2-0-dev \ -# Language extension gv_python & gv_python2 -python2.7-dev \ # Language extension gv_python3 libpython3-dev \ # Language extension gv_ruby diff --git a/ci/ubuntu-20.10/Dockerfile b/ci/ubuntu-20.10/Dockerfile index 497269704..62554eb93 100644 --- a/ci/ubuntu-20.10/Dockerfile +++ b/ci/ubuntu-20.10/Dockerfile @@ -72,8 +72,6 @@ libperl-dev \ php-dev \ libsodium-dev \ libargon2-0-dev \ -# Language extension gv_python & gv_python2 -python2.7-dev \ # Language extension gv_python3 libpython3-dev \ # Language extension gv_ruby diff --git a/ci/ubuntu-21.04/Dockerfile b/ci/ubuntu-21.04/Dockerfile index 962f8b327..2393872a8 100644 --- a/ci/ubuntu-21.04/Dockerfile +++ b/ci/ubuntu-21.04/Dockerfile @@ -72,8 +72,6 @@ libperl-dev \ php-dev \ libsodium-dev \ libargon2-0-dev \ -# Language extension gv_python & gv_python2 -python2.7-dev \ # Language extension gv_python3 libpython3-dev \ # Language extension gv_ruby diff --git a/configure.ac b/configure.ac index 29055cfcf..257386c45 100644 --- a/configure.ac +++ b/configure.ac @@ -1256,65 +1256,6 @@ else fi AM_CONDITIONAL(WITH_PYTHON, [test "x$use_python" = "xYes"]) -dnl ----------------------------------- -dnl INCLUDES and LIBS for PYTHON2 - -AC_ARG_ENABLE(python2, - [AS_HELP_STRING([--enable-python2=yes],[python2 language bindings])], - [], [enable_python2=yes]) - -if test "x$enable_python2" != "xyes"; then - use_python2="No (disabled)" -else - if test "x$use_swig" != "xYes"; then - use_python2="No (swig not available)" - else - if test `$SWIG -help 2>&1 | $EGREP -c '\-python *- Generate'` = 0; then - use_python="No (swig does not support -python option)" - else - AC_CHECK_PROG(PYTHON2,python2,python2) - if test "x$PYTHON2" = "x"; then - use_python2="No (python2 not available)" - else - PYTHON2_VERSION=`$PYTHON2 -c "import sys; print('%d.%d' % sys.version_info[[0:2]])"` - if test "x$PYTHON2_VERSION" = "x"; then - PYTHON2= - else - PYTHON2_VERSION_MAJOR=`echo $PYTHON2_VERSION | cut -d '.' -f 1` - PYTHON2_VERSION_MINOR=`echo $PYTHON2_VERSION | cut -d '.' -f 2` - if test $PYTHON2_VERSION_MINOR -lt 3; then - PYTHON2= - fi - fi - fi - if test "x$PYTHON2" = "x"; then - use_python2="No (python2 is too old)" - else - if test "x$PKG_CONFIG" != "x"; then - AC_MSG_CHECKING(for Python2 headers and libraries with pkg-config) - echo - pkgconfig_python2_found=`$PKG_CONFIG --exists python-$PYTHON2_VERSION 2>/dev/null` - if test "x$?" = "x0" ; then - PYTHON2_INCLUDES="$PYTHON2_CFLAGS "`$PKG_CONFIG --cflags python-$PYTHON2_VERSION` - PYTHON2_LIBS="$PYTHON2_LFLAGS "`$PKG_CONFIG --libs python-$PYTHON2_VERSION` - else - use_python2="No (python-$PYTHON2_VERSION.pc not found)" - PYTHON2= - fi - fi - PYTHON2_INSTALL_DIR="`$PYTHON2 $srcdir/config/config_python.py archsitelib`" - if test "x$PYTHON2" != "x"; then - use_python2="Yes" - AC_SUBST([PYTHON2_INSTALL_DIR]) - AC_SUBST([PYTHON2_INCLUDES]) - AC_SUBST([PYTHON2_LIBS]) - fi - fi - fi - fi -fi -AM_CONDITIONAL(WITH_PYTHON2, [test "x$use_python2" = "xYes"]) - dnl ----------------------------------- dnl INCLUDES and LIBS for PYTHON3 @@ -3146,7 +3087,6 @@ echo " gv_ocaml: $use_ocaml" echo " gv_perl: $use_perl" echo " gv_php: $use_php" echo " gv_python: $use_python" -echo " gv_python2: $use_python2" echo " gv_python3: $use_python3" echo " gv_R: $use_r" echo " gv_ruby: $use_ruby" diff --git a/debian/rules b/debian/rules index ded9a6d57..3124c02b5 100755 --- a/debian/rules +++ b/debian/rules @@ -33,7 +33,7 @@ LUA_PACKAGE = $(CURDIR)/debian/libgv-lua DEV_PACKAGE = $(CURDIR)/debian/libgraphviz-dev -PYTHON_VERSIONS = $(shell python2 --version 2>&1 | sed 's/.* \(.*\)\..*/python\1/'; python3 --version 2>&1 | sed 's/.* \(.*\)\..*/python\1/') +PYTHON_VERSIONS = $(shell python3 --version 2>&1 | sed 's/.* \(.*\)\..*/python\1/') PYTHON_PACKAGE = $(CURDIR)/debian/libgv-python RUBY_VERSION = 1.8 @@ -259,7 +259,6 @@ binary-arch: build install dh_installman -a dh_installchangelogs CHANGELOG.md -a dh_perl -a - dh_python2 -a dh_link -a dh_strip -a dh_compress -a diff --git a/redhat/graphviz.spec.fedora.in b/redhat/graphviz.spec.fedora.in index 685efe864..f9010da94 100644 --- a/redhat/graphviz.spec.fedora.in +++ b/redhat/graphviz.spec.fedora.in @@ -32,7 +32,6 @@ Source0: https://gitlab.com/graphviz/graphviz/-/archive/@VERSION@/graphviz-@VERS %global LASI 1 %global OCAML 1 %global WEBP 1 -%global PYTHON2 1 %global PYTHON3 1 %global QT5 1 # Not yet. @@ -107,9 +106,6 @@ BuildRequires: lasi-devel %if %{OCAML} BuildRequires: ocaml %endif -%if %{PYTHON2} -BuildRequires: python2 python2-devel -%endif %if %{PYTHON3} BuildRequires: python3 python3-devel %endif @@ -750,27 +746,6 @@ PHP extension for graphviz. %exclude %{_libdir}/graphviz/php/*.so %exclude %{_libdir}/graphviz/php/*.php -#-- graphviz-lang-python2 rpm ------------------------------------------- -%if %{PYTHON2} -%package lang-python2 -Group: Applications/Multimedia -Summary: Python extension for graphviz -Requires: %{name} = %{version}-%{release}, python2 -Conflicts: %{name}-python <= 2.41 -Conflicts: %{name}-lang-python <= 2.41 - -%description lang-python2 -Python extension for graphviz. - -%files lang-python2 -%defattr(-,root,root,-) -%{_libdir}/python2*/* -%{_datadir}/graphviz/demo/*.py* -%{_mandir}/man3/gv.3python.* -%exclude %{_libdir}/graphviz/python2/*.so -%exclude %{_libdir}/graphviz/python2/*.py* -%endif - #-- graphviz-lang-python3 rpm ------------------------------------------- %if %{PYTHON3} %package lang-python3 @@ -964,9 +939,6 @@ CFLAGS="$RPM_OPT_FLAGS" \ --without-ann \ %endif --disable-python \ -%if ! %{PYTHON2} - --disable-python2 \ -%endif %if ! %{PYTHON3} --disable-python3 \ %endif diff --git a/tclpkg/Makefile.am b/tclpkg/Makefile.am index d03cc5b38..f899f178d 100644 --- a/tclpkg/Makefile.am +++ b/tclpkg/Makefile.am @@ -10,7 +10,6 @@ pkgocamldir = $(pkglibdir)/ocaml pkgperldir = $(pkglibdir)/perl pkgphpdir = $(pkglibdir)/php pkgpythondir = $(pkglibdir)/python -pkgpython2dir = $(pkglibdir)/python2 pkgpython3dir = $(pkglibdir)/python3 pkgRdir = $(pkglibdir)/R pkgrubydir = $(pkglibdir)/ruby @@ -83,17 +82,6 @@ if WITH_PYTHON echo "Skipping system installation of python binding."; \ fi endif -if WITH_PYTHON2 - -mkdir -p $(DESTDIR)@PYTHON2_INSTALL_DIR@; - if test -w $(DESTDIR)@PYTHON2_INSTALL_DIR@; then \ - (cd $(DESTDIR)@PYTHON2_INSTALL_DIR@; \ - cp -f $(DESTDIR)$(pkgpython2dir)/libgv_python2.so _gv.so; \ - cp -f $(DESTDIR)$(pkgpython2dir)/gv.py gv.py;) \ - else \ - echo "Warning: @PYTHON2_INSTALL_DIR@ is not writable."; \ - echo "Skipping system installation of python2 binding."; \ - fi -endif if WITH_PYTHON3 -mkdir -p $(DESTDIR)@PYTHON3_INSTALL_DIR@; if test -w $(DESTDIR)@PYTHON3_INSTALL_DIR@; then \ @@ -143,8 +131,6 @@ uninstall-hook: -rm -rf $(DESTDIR)@PHP_INSTALL_DIR@/gv.so $(DESTDIR)@PHP_INSTALL_DATADIR@/gv.php; -rm -rf $(DESTDIR)$(pkgpythondir); -rm -rf $(DESTDIR)@PYTHON_INSTALL_DIR@/_gv.so $(DESTDIR)@PYTHON_INSTALL_DIR@/gv.py; - -rm -rf $(DESTDIR)$(pkgpython2dir); - -rm -rf $(DESTDIR)@PYTHON2_INSTALL_DIR@/_gv.so $(DESTDIR)@PYTHON2_INSTALL_DIR@/gv.py; -rm -rf $(DESTDIR)$(pkgpython3dir); -rm -rf $(DESTDIR)@PYTHON3_INSTALL_DIR@/_gv.so $(DESTDIR)@PYTHON3_INSTALL_DIR@/gv.py; -rm -rf $(DESTDIR)$(pkgpython23dir); diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index 8941c2220..476b0fcfc 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -228,17 +228,6 @@ $(PYTHON_data): gv_python.cpp gv_python.cpp: gv.i $(SWIG) -c++ -python -o gv_python.cpp $(srcdir)/gv.i -pkgpython2dir = $(pkglibdir)/python2 -PYTHON2_data = gv.py -nodist_libgv_python2_la_SOURCES = gv_python2.cpp $(PYTHON2_data) -libgv_python2_la_SOURCES = $(BASESOURCES) gv_dummy_init.c -libgv_python2_la_LIBADD = $(BASELIBS) $(PYTHON2_LIBS) -libgv_python2_la_LDFLAGS = -module -avoid-version -libgv_python2_la_CPPFLAGS = $(BASECPPFLAGS) $(PYTHON2_INCLUDES) -$(PYTHON2_data): gv_python2.cpp -gv_python2.cpp: gv.i - $(SWIG) -c++ -python -o gv_python2.cpp $(srcdir)/gv.i - pkgpython3dir = $(pkglibdir)/python3 PYTHON3_data = gv.py nodist_libgv_python3_la_SOURCES = gv_python3.cpp $(PYTHON3_data) @@ -387,11 +376,6 @@ pkgpython_DATA = $(PYTHON_data) pkgpython_LTLIBRARIES = libgv_python.la DEVTSTS += test_python endif -if WITH_PYTHON2 -pkgpython2_DATA = $(PYTHON2_data) -pkgpython2_LTLIBRARIES = libgv_python2.la -DEVTSTS += test_python2 -endif if WITH_PYTHON3 pkgpython3_DATA = $(PYTHON3_data) pkgpython3_LTLIBRARIES = libgv_python3.la @@ -549,9 +533,6 @@ endif if WITH_PYTHON (cd $(DESTDIR)$(pkgpythondir); rm -f _gv.so; $(LN_S) libgv_python.so _gv.so;) endif -if WITH_PYTHON2 - (cd $(DESTDIR)$(pkgpython2dir); rm -f _gv.so; $(LN_S) libgv_python2.so _gv.so;) -endif if WITH_PYTHON3 (cd $(DESTDIR)$(pkgpython3dir); rm -f _gv.so; $(LN_S) libgv_python3.so _gv.so;) endif @@ -642,13 +623,6 @@ test_python: libgv_python.la ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.py .; \ PYTHONPATH=. $(PYTHON) test.py) -.PHONY: test_python2 -test_python2: libgv_python2.la - -(mkdir -p test_python2; cd test_python2; \ - ln -fs ../.libs/libgv_python2.so _gv.so; \ - ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.py .; \ - PYTHONPATH=. $(PYTHON2) test.py) - .PHONY: test_python3 test_python3: libgv_python3.la -(mkdir -p test_python3; cd test_python3; \ @@ -690,7 +664,6 @@ CLEANFILES = test_*/* pkgIndex.tcl \ gv_perl.cpp $(PERL_data) \ gv_php.cpp $(PHP_data) \ gv_python.cpp $(PYTHON_data) gv.pyc \ - gv_python2.cpp $(PYTHON2_data) gv.pyc \ gv_python3.cpp $(PYTHON3_data) gv.pyc \ gv_R.cpp $(R_data) \ gv_ruby.cpp $(RUBY_data) \ diff --git a/tclpkg/gv/demo/Makefile.am b/tclpkg/gv/demo/Makefile.am index e541ebbf4..d33e74af4 100644 --- a/tclpkg/gv/demo/Makefile.am +++ b/tclpkg/gv/demo/Makefile.am @@ -9,7 +9,6 @@ demoocamldir = $(pkgdatadir)/demo demoperldir = $(pkgdatadir)/demo demophpdir = $(pkgdatadir)/demo demopythondir = $(pkgdatadir)/demo -demopython2dir = $(pkgdatadir)/demo demopython3dir = $(pkgdatadir)/demo demoRdir = $(pkgdatadir)/demo demorubydir = $(pkgdatadir)/demo @@ -42,9 +41,6 @@ endif if WITH_PYTHON demopython_SCRIPTS = modgraph.py endif -if WITH_PYTHON2 -demopython2_SCRIPTS = modgraph.py -endif if WITH_PYTHON3 demopython3_SCRIPTS = modgraph.py endif diff --git a/tclpkg/gv/gv_doc_langs.tcl b/tclpkg/gv/gv_doc_langs.tcl index 94ba8ded9..c7a49fe25 100644 --- a/tclpkg/gv/gv_doc_langs.tcl +++ b/tclpkg/gv/gv_doc_langs.tcl @@ -401,52 +401,6 @@ array set LANGS { USAGE { } } - python2 { - TYPES { - {Agraph_t* g} graph_handle - {Agraph_t* sg} subgraph_handle - {Agnode_t* n} node_handle - {Agnode_t* t} tail_node_handle - {Agnode_t* h} head_node_handle - {Agedge_t* e} edge_handle - {Agsym_t* a} attr_handle - {char* gne} type - {char* name} name - {char* tname} tail_name - {char* hname} head_name - {char* attr} attr_name - {char* val} attr_value - {const char* filename} filename - {char* engine} engine - {char* string} string - {char** outdata} outdata - {char* format} format - {FILE* f} channel - {void** data} data_handle - Agraph_t* graph_handle - Agnode_t* node_handle - Agedge_t* edge_handle - Agsym_t* attribute_handle - char* string - {const char*} string - char** outdata - FILE* channel - bool bool - int int - void** data_handle - void {} - } - SYNTAX { - gv. ( {, } {);} - } - SYNOPSIS { - {#!/usr/bin/python2} - {import sys} - {import gv} - } - USAGE { - } - } python3 { TYPES { {Agraph_t* g} graph_handle