From nobody Sat Feb 7 15:26:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569582728; cv=none; d=zoho.com; s=zohoarc; b=Bzg5HBjWNi68G4YK7VkQbVbSmB8InQnYD/BVKdETrxE+aQZkcSfdC6/LE5lF7cC7MXPABxZdlv/QfxNSxhJqya6IyOBR3A+gXGu92mcwk7cNH8LB2JLbfXVvHm5Tj6VnuVJruS0h/PZ/L7IBrFOLG9yJuEvEXWJPXhlaNCf68Ic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582728; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rl5I312l040gtvWPpH9eqXn+pZeDjaXyFDF35h4ViiQ=; b=b3CpenlNRz5K0pvPUpj5xDoEdI7prCRHniuH5EEam+w0o5Dfj7oXz+4WS0wQEnb+QHvCK0zV8PLGAJY4lPdpptVHXRxHFg21HIGMCgqfOuMsjGh8WTuriNyF6rK7CLBFHH4v+gsJvFt9d8FiYanxQID2/eHHI8/kawZMdqGb9So= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582728761183.52715690354842; Fri, 27 Sep 2019 04:12:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB42E300894D; Fri, 27 Sep 2019 11:12:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77A58600C6; Fri, 27 Sep 2019 11:12:06 +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 08B691803B47; Fri, 27 Sep 2019 11:12:06 +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 x8RBC4PI028195 for ; Fri, 27 Sep 2019 07:12:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id E576760C18; Fri, 27 Sep 2019 11:12:04 +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 358C460BF3; Fri, 27 Sep 2019 11:12:04 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:49 +0100 Message-Id: <20190927111158.20653-3-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-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 Cc: Pavel Hrdina Subject: [libvirt] [PATCH 02/11] build: drop support for python2, requiring python3 only 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 27 Sep 2019 11:12:07 +0000 (UTC) Meson requires python 3 and python 2 is end of life at the end of the year. This is the bare minimum cleanup which simply drops any "from __future__" usage and updates the shbang line. Signed-off-by: Daniel P. Berrang=C3=A9 --- configure.ac | 4 ++-- docs/apibuild.py | 4 +--- docs/reformat-news.py | 4 +--- libvirt.spec.in | 9 +-------- src/esx/esx_vi_generator.py | 4 +--- src/hyperv/hyperv_wmi_generator.py | 4 +--- tests/cputestdata/cpu-gather.sh | 9 +-------- 7 files changed, 8 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index 2855d8cab0..f5c6fabc6d 100644 --- a/configure.ac +++ b/configure.ac @@ -706,9 +706,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 92886e1276..0242ff81be 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 955ce2d45b..c2dfc138bc 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 29839fad77..20d4c0444b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -175,13 +175,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 - =20 %if %{with_qemu} || %{with_lxc} # numad is used to manage the CPU and memory placement dynamically, @@ -268,7 +261,7 @@ BuildRequires: perl-interpreter %else BuildRequires: perl %endif -BuildRequires: %{python} +BuildRequires: python3 BuildRequires: systemd-units %if %{with_libxl} BuildRequires: xen-devel diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 28d440a6df..1be42210ff 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 a9ece0ff00..d12d15d012 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 <