Skip to content

Conversation

@ldionne
Copy link
Member

@ldionne ldionne commented Oct 3, 2025

This patch fixes various Flake8 issues in the codebase to make the Github Actions CI closer to passing.
Issues were related to whitespace, unused imports, bad indentation, etc.

Most missing imports were caused by typing annotations that were only in comments. I upgraded those to actual
type annotations when Tox was complaining, except for a few __all__ instances: I really don't think there is a large benefit from using strong typing for the __all__ module variable.

@ldionne ldionne force-pushed the review/trigger-gh-action branch from 146600d to 76f3ce1 Compare October 3, 2025 00:08
@ldionne ldionne changed the title Dummy PR to trigger the Github action Fix various Flake8 issues in the codebase Oct 3, 2025
@ldionne ldionne merged commit da59ce3 into llvm:main Oct 3, 2025
1 of 2 checks passed
@ldionne ldionne deleted the review/trigger-gh-action branch October 3, 2025 13:38

def baseline():
# type: () -> Optional[testsuitedb.TestSuiteDB.Baseline]
def baseline() -> Optional[testsuitedb.TestSuiteDB.Baseline]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our bots that use the lnt runner are now failing with:

  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/tests/test_suite.py", line 32, in <module>
    from lnt.tests.builtintest import BuiltinTest
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/tests/builtintest.py", line 11, in <module>
    import lnt.util.ImportData as ImportData
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/util/ImportData.py", line 1, in <module>
    from lnt.util import NTEmailReport
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/util/NTEmailReport.py", line 2, in <module>
    import lnt.server.reporting.runs
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/server/reporting/runs.py", line 8, in <module>
    import lnt.server.ui.app
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/server/ui/app.py", line 27, in <module>
    import lnt.server.ui.profile_views
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/server/ui/profile_views.py", line 11, in <module>
    from lnt.server.ui.views import ts_data
  File "/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/test/lnt/lnt/server/ui/views.py", line 1844, in <module>
    def baseline() -> Optional[testsuitedb.TestSuiteDB.Baseline]:
AttributeError: type object 'TestSuiteDB' has no attribute 'Baseline'

https://lab.llvm.org/buildbot/#/builders/17/builds/11544/steps/14/logs/stdio

I presume this is the switch from an optional type hint to something that always had to be parseable. Which suggests that Baseline was removed at some point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually Baseline is a sort of internal type of TestSuiteDB, and it does assign it as self.Baseline = Baseline. Maybe during a type hint, only the class itself is available and self. is assigning into an instance of it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants