From: Namhyung Kim <namhyung@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>, Leo Yan <leo.yan@arm.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] perf python: Clean up and restructure setup.py
Date: Wed, 22 Jul 2026 22:32:09 -0700 [thread overview]
Message-ID: <amGnWXQgP9Hu5xUT@google.com> (raw)
In-Reply-To: <CAP-5=fWD+zy8NKWyUieF-Kk4q5yEjr+qYVbU-vhT85McLeaxUg@mail.gmail.com>
On Wed, Jul 22, 2026 at 09:51:34AM -0700, Ian Rogers wrote:
> On Thu, May 21, 2026 at 10:55 AM Ian Rogers <irogers@google.com> wrote:
> >
> > Clean up and restructure the python setup script to resolve pylint
> > warnings, improve code quality, and increase robustness and
> > readability, targeting Python 3.9+ (the Linux kernel build minimum
> > Python version).
> >
> > Changes:
> > - Restructure the script to use a `main()` function as the entry point,
> > leaving only imports, classes, and pure functions at module level.
> > - Eliminate all global/module-level variables, making them local to
> > `main()` or the respective classes/functions.
> > - Make `clang_has_option` a pure function by passing all necessary
> > parameters explicitly.
> > - Extract clang compiler flag filtering into a new
> > `filter_clang_options` helper function. This function uses a loop
> > over a tuple of options, replacing ~30 lines of repetitive blocks
> > and reducing branch/statement complexity in the main flow.
> > - Cleanly define attributes in `__init__` for `BuildExt` and `InstallLib`
> > and read environment variables dynamically within the methods, removing
> > their dependency on global variables.
> > - Replace legacy Popen with subprocess.run for safer process handling.
> > - Use list-based flag filtering (split, filter, re-join) instead of regex
> > `re.sub` substitutions on space-separated compiler flag strings. This
> > avoids boundary bugs and safely handles flags with arguments (e.g.
> > `-fcf-protection=full`).
> > - Safely parse `CC` env var using `shlex.split` to handle quotes and pass
> > compiler arguments as `list[str]` lists to helper functions, avoiding
> > redundant string formatting and parsing.
> > - Remove unused `import re`.
> > - Rename setuptools command subclasses to PascalCase (BuildExt, InstallLib).
> > - Add type annotations to functions and methods.
> > - Add missing docstrings for module, functions, and classes.
> > - Split long lines to adhere to standard limits.
> >
> > Assisted-by: Antigravity:gemini-3.5-flash
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
> Ping.
Sorry for the delay. Can you please resend the series?
Thanks,
Namhyung
prev parent reply other threads:[~2026-07-23 5:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 17:55 [PATCH v1] perf python: Clean up and restructure setup.py Ian Rogers
2026-07-22 16:51 ` Ian Rogers
2026-07-23 5:32 ` Namhyung Kim [this message]
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=amGnWXQgP9Hu5xUT@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/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