* perf build: default build fails in pylint (pylint 4, missing optional modules)
@ 2026-10-18 7:01 Lalit Maganti
2026-10-23 13:40 ` Leo Yan
0 siblings, 1 reply; 2+ messages in thread
From: Lalit Maganti @ 2026-10-18 7:01 UTC (permalink / raw)
To: irogers, alice.mei.rogers, acme, namhyung
Cc: james.clark, leo.yan, adrian.hunter, linux-perf-users,
Lalit Maganti
Hi Ian, Alice,
Since 5fe83fb352c8 ("perf build: Make pylint build test opt-out
(NO_PYLINT=1)") the build runs pylint whenever it is installed, and a
default build of perf-tools-next (1c90f0a3c8a1) now fails in pylint for
me, on Fedora 44 with Python 3.14.8 and pylint 4.1.3. With make -k, four
files fail:
pmu-events/jevents.py:1494:26: W4904: Using deprecated class FileType of module argparse (deprecated-class)
pmu-events/jevents.py:1496:33: W4904: Using deprecated class FileType of module argparse (deprecated-class)
tests/shell/lib/perf_json_output_lint.py:23:31: W4904: Using deprecated class FileType of module argparse (deprecated-class)
python/treport.py:12:0: E0401: Unable to import 'rich.markup' (import-error)
python/treport.py:625:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
python/ttimechart.py:33:0: E0401: Unable to import 'rich.segment' (import-error)
python/ttimechart.py:1086:8: W0201: Attribute 'virtual_size' defined outside __init__ (attribute-defined-outside-init)
(and a few more of the same kinds in treport.py and ttimechart.py)
There seem to be two separate things going on:
1. Python 3.14 marks argparse.FileType for deprecation (it raises a
PendingDeprecationWarning: "Simply open files after parsing
arguments"), which pylint 4 reports as deprecated-class. That needs
a code change in jevents.py and perf_json_output_lint.py.
2. The rest only happens because the optional textual and rich modules
are not installed: the imports fail, and pylint then cannot see that
textual's App and ScrollView define sub_title and virtual_size. With
textual and rich installed, treport.py and ttimechart.py pass, but if
that environment lacks setuptools, util/setup.py fails instead:
util/setup.py:15:0: E0401: Unable to import 'setuptools' (import-error)
So whether the default build passes depends on which optional Python
modules happen to be installed alongside pylint. Should import-error
be disabled (or those modules be in ignored-modules) for the default
build?
NO_PYLINT=1 works around both. For mypy 2.x, which fails on jevents.py
in a similar way, I've sent a fix separately:
"perf pmu-events: Fix jevents.py type annotations for mypy 2.x".
Thanks,
Lalit
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: perf build: default build fails in pylint (pylint 4, missing optional modules)
2026-10-18 7:01 perf build: default build fails in pylint (pylint 4, missing optional modules) Lalit Maganti
@ 2026-10-23 13:40 ` Leo Yan
0 siblings, 0 replies; 2+ messages in thread
From: Leo Yan @ 2026-10-23 13:40 UTC (permalink / raw)
To: Lalit Maganti
Cc: irogers, alice.mei.rogers, acme, namhyung, james.clark, leo.yan,
adrian.hunter, linux-perf-users
On Sun, Oct 18, 2026 at 08:01:10AM +0100, Lalit Maganti wrote:
[...]
> Since 5fe83fb352c8 ("perf build: Make pylint build test opt-out
> (NO_PYLINT=1)") the build runs pylint whenever it is installed, and a
> default build of perf-tools-next (1c90f0a3c8a1) now fails in pylint for
> me, on Fedora 44 with Python 3.14.8 and pylint 4.1.3. With make -k, four
> files fail:
>
> python/treport.py:625:8: W0201: Attribute 'sub_title' defined outside __init__ (attribute-defined-outside-init)
> python/ttimechart.py:1086:8: W0201: Attribute 'virtual_size' defined outside __init__ (attribute-defined-outside-init)
> (and a few more of the same kinds in treport.py and ttimechart.py)
I try to avoid duplicating others' work, but our CI failed to build perf
due to W0201 warning, so I sent two patches to fix it:
https://lore.kernel.org/linux-perf-users/20261023-perf_fix_pylint_warning-v1-0-b9da8dae2fe9@arm.com/T/#t
I haven't found other reported issues so far, so I'll leave it to Ian
and Alice to take a look.
Thanks,
Leo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-23 13:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 7:01 perf build: default build fails in pylint (pylint 4, missing optional modules) Lalit Maganti
2026-10-23 13:40 ` Leo Yan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox