From nobody Sun May 5 08:17:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575454472; cv=none; d=zohomail.com; s=zohoarc; b=iTk5WfVtfz18LxO/wrlsSFB+78ZjYAqgnySfdc0T3mlG5L5fCJYeyhmm2SOQHxun0UGPXD1iE2wYDxE6ANuTUjYUYuujII++2RJ0jX/QPcf1T/t0Xxg2dLZZW7KTehBennUlhw97dlRAuo/qAj3eweKfoWLD9Ry5sLlwal0jRKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575454472; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=GvaHCfRqDfDQuciu/ACrOkD5QXlNyWgrM2nIVEiSzHE=; b=c59sDnL0IdJniGOx6OTC2zJs1JKnHbf0NT+2R2oDiEu9ydgrTVYe2+Bp0ubgRQZCC9P/sTyNdLiCTdfTH4BDR4VMRcGI1xi+toediCujE4iK8Ym+qnIeH9BRsM5vIJFFwCytsA+y4FiagvLuBitqMcq6yTHHUT01tOpKWaE3cNo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1575454472223984.4434681890955; Wed, 4 Dec 2019 02:14:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-ajDFZzzMM0CXhN2uZkLh6g-1; Wed, 04 Dec 2019 05:14:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2926018A6EC6; Wed, 4 Dec 2019 10:14:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0EEF60C63; Wed, 4 Dec 2019 10:14:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5F9D35BC08; Wed, 4 Dec 2019 10:14:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB4AEHQl025247 for ; Wed, 4 Dec 2019 05:14:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 46D3A60C87; Wed, 4 Dec 2019 10:14:17 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8913D60C80; Wed, 4 Dec 2019 10:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575454470; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GvaHCfRqDfDQuciu/ACrOkD5QXlNyWgrM2nIVEiSzHE=; b=MQ4VTvvuwCMMK5k8OzQKaT/AMHMXwBxKQz15+9Avhx9FB2D0n+43TxfJiAfySh3BLL8ie6 mrojPfGQs6aYgq//kIKa9KldZeiyBDnh/Uds4gcPtO/t06OiMvvTjX31HyO37yt7vvPXbe xRdUYYAFKJXmSfFoQxKgTO2TkZWRblI= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 4 Dec 2019 10:14:12 +0000 Message-Id: <20191204101412.19753-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] build: only support python3 binary X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: ajDFZzzMM0CXhN2uZkLh6g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) python2 will be end of life by the time of the next libvirt release. All our supported build targets, including CentOS7, have a python3 build available. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- configure.ac | 4 ++-- docs/apibuild.py | 4 +--- docs/reformat-news.py | 4 +--- libvirt.spec.in | 10 +--------- scripts/augeas-gentest.py | 4 +--- scripts/check-aclperms.py | 4 +--- scripts/check-aclrules.py | 4 +--- scripts/check-driverimpls.py | 4 +--- scripts/check-drivername.py | 4 +--- scripts/check-symfile.py | 4 +--- scripts/check-symsorting.py | 4 +--- scripts/dtrace2systemtap.py | 4 +--- scripts/genpolkit.py | 4 +--- scripts/gensystemtap.py | 4 +--- scripts/header-ifdef.py | 4 +--- scripts/minimize-po.py | 4 +--- scripts/mock-noinline.py | 4 +--- scripts/prohibit-duplicate-header.py | 4 +--- src/esx/esx_vi_generator.py | 4 +--- src/hyperv/hyperv_wmi_generator.py | 4 +--- tests/cputestdata/cpu-gather.sh | 9 +-------- 21 files changed, 22 insertions(+), 73 deletions(-) diff --git a/configure.ac b/configure.ac index 76d28d2f67..2e5af075ea 100644 --- a/configure.ac +++ b/configure.ac @@ -701,9 +701,9 @@ if test "$with_linux" =3D "yes"; then fi =20 dnl Allow perl/python overrides -AC_PATH_PROGS([PYTHON], [python3 python2 python]) +AC_PATH_PROGS([PYTHON], [python3]) if test -z "$PYTHON"; then - AC_MSG_ERROR(['python3', 'python2' or 'python' binary is required to b= uild libvirt]) + AC_MSG_ERROR(['python3' binary is required to build libvirt]) fi AC_PATH_PROG([FLAKE8], [flake8]) if test -z "$FLAKE8"; then diff --git a/docs/apibuild.py b/docs/apibuild.py index 5a0224c1c6..2f7314b379 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # This is the API builder, it parses the C sources and build the # API formal description in XML. @@ -8,8 +8,6 @@ # daniel@veillard.com # =20 -from __future__ import print_function - import os import sys import glob diff --git a/docs/reformat-news.py b/docs/reformat-news.py index a06f945c02..7bc752d821 100755 --- a/docs/reformat-news.py +++ b/docs/reformat-news.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 =20 # reformat-news.py: Reformat the NEWS file properly # @@ -18,8 +18,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import sys =20 COLUMNS =3D 80 diff --git a/libvirt.spec.in b/libvirt.spec.in index 4c6161a26f..72ed2fd96b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -188,14 +188,6 @@ =20 %define with_bash_completion 0%{!?_without_bash_completion:1} =20 -# Use Python 3 when possible, Python 2 otherwise -%if 0%{?fedora} || 0%{?rhel} > 7 - %define python python3 -%else - %define python python2 -%endif - - %if %{with_qemu} || %{with_lxc} # numad is used to manage the CPU and memory placement dynamically, # it's not available on many non-x86 architectures. @@ -281,7 +273,7 @@ BuildRequires: perl-interpreter %else BuildRequires: perl %endif -BuildRequires: %{python} +BuildRequires: python3 BuildRequires: systemd-units %if %{with_libxl} BuildRequires: xen-devel diff --git a/scripts/augeas-gentest.py b/scripts/augeas-gentest.py index 60e12fb77e..8976785cad 100755 --- a/scripts/augeas-gentest.py +++ b/scripts/augeas-gentest.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2012-2019 Red Hat, Inc. # @@ -19,8 +19,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/check-aclperms.py b/scripts/check-aclperms.py index b1084a3758..67de0efabd 100755 --- a/scripts/check-aclperms.py +++ b/scripts/check-aclperms.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2013-2019 Red Hat, Inc. # @@ -21,8 +21,6 @@ # a lot of auto-generation of code, so when these don't match # problems occur, preventing auth from succeeding at all. =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/check-aclrules.py b/scripts/check-aclrules.py index 5a7d275410..a1fa473174 100755 --- a/scripts/check-aclrules.py +++ b/scripts/check-aclrules.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2013-2019 Red Hat, Inc. # @@ -32,8 +32,6 @@ # detected EnsureACL call recorded. # =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/check-driverimpls.py b/scripts/check-driverimpls.py index bc3f16a816..8289b8051e 100755 --- a/scripts/check-driverimpls.py +++ b/scripts/check-driverimpls.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2013-2019 Red Hat, Inc. # @@ -17,8 +17,6 @@ # . # =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/check-drivername.py b/scripts/check-drivername.py index ba77a6d48d..39eff836c7 100644 --- a/scripts/check-drivername.py +++ b/scripts/check-drivername.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2013-2019 Red Hat, Inc. # @@ -17,8 +17,6 @@ # . # =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/check-symfile.py b/scripts/check-symfile.py index 7aeb047d89..0f6e780df0 100755 --- a/scripts/check-symfile.py +++ b/scripts/check-symfile.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2012-2019 Red Hat, Inc. # @@ -16,8 +16,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import re import subprocess import sys diff --git a/scripts/check-symsorting.py b/scripts/check-symsorting.py index 8e698c0657..fd00449c44 100755 --- a/scripts/check-symsorting.py +++ b/scripts/check-symsorting.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 =20 # Copyright (C) 2012-2019 Red Hat, Inc. # @@ -16,8 +16,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import os.path import re import sys diff --git a/scripts/dtrace2systemtap.py b/scripts/dtrace2systemtap.py index d6bf1f8d1f..506db9c503 100755 --- a/scripts/dtrace2systemtap.py +++ b/scripts/dtrace2systemtap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2011-2019 Red Hat, Inc. # @@ -23,8 +23,6 @@ # python dtrace2systemtap.py probes.d > libvirt_probes.stp # =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/genpolkit.py b/scripts/genpolkit.py index 230d920f70..8845ea44e0 100755 --- a/scripts/genpolkit.py +++ b/scripts/genpolkit.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2012-2019 Red Hat, Inc. # @@ -17,8 +17,6 @@ # . # =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/gensystemtap.py b/scripts/gensystemtap.py index 7b391cc911..ad808e3033 100755 --- a/scripts/gensystemtap.py +++ b/scripts/gensystemtap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2011-2019 Red Hat, Inc. # @@ -22,8 +22,6 @@ # python gensystemtap.py */*.x > libvirt_functions.stp # =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/header-ifdef.py b/scripts/header-ifdef.py index d5ec7b45fe..e668875f18 100644 --- a/scripts/header-ifdef.py +++ b/scripts/header-ifdef.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2018-2019 Red Hat, Inc. # @@ -44,8 +44,6 @@ # ....content.... # #endif /* SYMBOL */ =20 -from __future__ import print_function - import os.path import re import sys diff --git a/scripts/minimize-po.py b/scripts/minimize-po.py index d548b427e9..c305229721 100755 --- a/scripts/minimize-po.py +++ b/scripts/minimize-po.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2018-2019 Red Hat, Inc. # @@ -16,8 +16,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/mock-noinline.py b/scripts/mock-noinline.py index b338c5f097..4fc60c0be3 100644 --- a/scripts/mock-noinline.py +++ b/scripts/mock-noinline.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2017-2019 Red Hat, Inc. # @@ -16,8 +16,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import re import sys =20 diff --git a/scripts/prohibit-duplicate-header.py b/scripts/prohibit-duplic= ate-header.py index 420311ccef..33a91ddbc5 100644 --- a/scripts/prohibit-duplicate-header.py +++ b/scripts/prohibit-duplicate-header.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2016-2019 Red Hat, Inc. # @@ -16,8 +16,6 @@ # License along with this library. If not, see # . =20 -from __future__ import print_function - import re import sys =20 diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 2f685c0898..048f5dde9e 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 =20 # # esx_vi_generator.py: generates most of the SOAP type mapping code @@ -22,8 +22,6 @@ # . # =20 -from __future__ import print_function - import sys import os import os.path diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 3001f222f7..736eabd598 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 =20 # # hyperv_wmi_generator.py: generates most of the WMI type mapping code @@ -20,8 +20,6 @@ # . # =20 -from __future__ import print_function - import sys import os import os.path diff --git a/tests/cputestdata/cpu-gather.sh b/tests/cputestdata/cpu-gather= .sh index cefd1b0d0d..79e3fddf22 100755 --- a/tests/cputestdata/cpu-gather.sh +++ b/tests/cputestdata/cpu-gather.sh @@ -9,9 +9,7 @@ grep 'model name' /proc/cpuinfo | head -n1 cpuid -1r echo =20 -for python in python3 python2; do - $python <