From patchwork Tue Sep 19 06:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 13390857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F686CD343F for ; Tue, 19 Sep 2023 06:31:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.604372.941719 (Exim 4.92) (envelope-from ) id 1qiUGA-00049m-Bn; Tue, 19 Sep 2023 06:30:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 604372.941719; Tue, 19 Sep 2023 06:30:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUGA-00049d-8i; Tue, 19 Sep 2023 06:30:58 +0000 Received: by outflank-mailman (input) for mailman id 604372; Tue, 19 Sep 2023 06:30:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUG8-000365-7E for xen-devel@lists.xenproject.org; Tue, 19 Sep 2023 06:30:56 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 15f4f1f1-56b6-11ee-8789-cb3800f73035; Tue, 19 Sep 2023 08:30:54 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-403012f276dso57094825e9.0 for ; Mon, 18 Sep 2023 23:30:55 -0700 (PDT) Received: from EMEAENG6DZjqCfH.citrite.net (cpc92302-cmbg19-2-0-cust781.5-4.cable.virginm.net. [82.1.211.14]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003fe17901fcdsm17068780wmf.32.2023.09.18.23.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 23:30:54 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 15f4f1f1-56b6-11ee-8789-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1695105054; x=1695709854; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5qAv5TR4Jv8y9/IqrcBV7oAsUEo56bvO6XuiR+P26ck=; b=Dj4Uba0/uO3kgF+0WJkf3KThH9xm58sFemj2Au4nLUjCVFGLZteoMYfNn6D4sQaSwk QvB7rdSU7+g5m0aJNqa/MToZKE+PFqVkfEXtN1SF6LApMzSZA5Ta3hQGkJhqymIVU1UH Vz/AfrF2fWcTb+6cgYCW9SvjeByX5rctAiJjA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695105054; x=1695709854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5qAv5TR4Jv8y9/IqrcBV7oAsUEo56bvO6XuiR+P26ck=; b=jXEipjwQUf21wtZqTKb+yqrYG41kn+S7w+gf9xWFq3BZkDbq3LrznSommJmWYlI6V4 dVNPB5W3S1G7YOT13yICcRfJ5Dp+4Uf8z/dWpb5zMt/sFr4+V7PmWcRW/EdLSlHrPXgF lcYKLYp6L/6je9nZO8296Po4z4tPvkKzFI7naOm6glWh6/j+aBtphr/K/uWZMUUSg3ZX JMZmaokij0hy7VEGkevk7rO033aTxRBJTvNLPXGiHpOmbuPFLTtxygDmpZMZcW2mDCDr qkVlhJmNG9lXjess1292yZRGakAW2mHR94NpY4TLOMpVEfYfFp9nPwlxpfE2Zv8XH1xV nhCA== X-Gm-Message-State: AOJu0YxMjwz2jJ6dVeaqGE7Ykymg3x6KKr225Zcyw/uAAskPMP8Z315O 9RsAxvus+Sg425BopDsDM+ymafSnKls9S2ivXOo= X-Google-Smtp-Source: AGHT+IF3F5TicFY2bZaPPfxI3vbGtjet1LnUeRlgKhqZkuTP7saiA9lgz54eojjPaWL++bqqsbFuOA== X-Received: by 2002:a05:600c:c8:b0:402:f5c2:c6d9 with SMTP id u8-20020a05600c00c800b00402f5c2c6d9mr10181859wmm.37.1695105054480; Mon, 18 Sep 2023 23:30:54 -0700 (PDT) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Stefano Stabellini , Andrew Cooper , Javi Merino , Wei Liu , Anthony PERARD Subject: [XEN PATCH v3 2/4] tools: convert setup.py to use setuptools if available Date: Tue, 19 Sep 2023 07:30:27 +0100 Message-ID: <761d876ad8755a98824ed7705afaed2cdb545dd8.1695104399.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 From: Marek Marczykowski-Górecki Python distutils is deprecated and is going to be removed in Python 3.12. Add support for setuptools. Setuptools in Python 3.11 complains: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. Keep using setup.py anyway to build the C extension. Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Javi Merino --- tools/pygrub/setup.py | 7 +++++-- tools/python/setup.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/pygrub/setup.py b/tools/pygrub/setup.py index 502aa4df2d..c9cac47eee 100644 --- a/tools/pygrub/setup.py +++ b/tools/pygrub/setup.py @@ -1,5 +1,8 @@ -from distutils.core import setup, Extension -from distutils.ccompiler import new_compiler +# Prefer setuptools, fall back to distutils +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension import os import sys diff --git a/tools/python/setup.py b/tools/python/setup.py index 721a3141d7..02354f6986 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -1,5 +1,8 @@ - -from distutils.core import setup, Extension +# Prefer setuptools, fall back to distutils +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension import os, sys XEN_ROOT = "../.."