mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: Ian Rogers <rogers.email@gmail.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] perf python: Avoid deprecation warning on distutils
Date: Mon, 18 Jul 2022 13:50:22 +0100	[thread overview]
Message-ID: <c0b64785-55f2-111c-cec7-a7a90f68f8ac@arm.com> (raw)
In-Reply-To: <20220615014206.26651-1-irogers@google.com>



On 15/06/2022 02:42, Ian Rogers wrote:
> Fix the following DeprecationWarning:
> 
> tools/perf/util/setup.py:31: DeprecationWarning: The distutils
> package is deprecated and slated for removal in Python 3.12. Use
> setuptools or check PEP 632 for potential alternatives
> 
> Note: the setuptools module may need installing, for example:
> sudo apt install python-setuptools
> 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/util/setup.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> index c255a2c90cd6..5a3c74bce836 100644
> --- a/tools/perf/util/setup.py
> +++ b/tools/perf/util/setup.py
> @@ -11,7 +11,7 @@ def clang_has_option(option):
>      return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o))] == [ ]
>  
>  if cc_is_clang:
> -    from distutils.sysconfig import get_config_vars
> +    from sysconfig import get_config_vars
>      vars = get_config_vars()
>      for var in ('CFLAGS', 'OPT'):
>          vars[var] = sub("-specs=[^ ]+", "", vars[var])
> @@ -28,10 +28,10 @@ if cc_is_clang:
>          if not clang_has_option("-ffat-lto-objects"):
>              vars[var] = sub("-ffat-lto-objects", "", vars[var])
>  
> -from distutils.core import setup, Extension
> +from setuptools import setup, Extension
>  
> -from distutils.command.build_ext   import build_ext   as _build_ext
> -from distutils.command.install_lib import install_lib as _install_lib
> +from setuptools.command.build_ext   import build_ext   as _build_ext
> +from setuptools.command.install_lib import install_lib as _install_lib
>  
>  class build_ext(_build_ext):
>      def finalize_options(self):

Tested it with python 2.7 and 3.8 by running "make install-python_ext PYTHON=..."

Reviewed-by: James Clark <james.clark@arm.com>

  reply	other threads:[~2022-07-18 12:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  1:42 Ian Rogers
2022-07-18 12:50 ` James Clark [this message]
2022-07-18 13:33   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0b64785-55f2-111c-cec7-a7a90f68f8ac@arm.com \
    --to=james.clark@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rogers.email@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®