-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[lit] cleanup unused imports #143930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lit] cleanup unused imports #143930
Conversation
@llvm/pr-subscribers-testing-tools @llvm/pr-subscribers-lld Author: Charles Zablit (charles-zablit) ChangesRemove imports that are not used in some lit test files. Full diff: https://github.com/llvm/llvm-project/pull/143930.diff 8 Files Affected:
diff --git a/lld/test/Unit/lit.cfg.py b/lld/test/Unit/lit.cfg.py
index 1cf890a05cb28..47375db517e96 100644
--- a/lld/test/Unit/lit.cfg.py
+++ b/lld/test/Unit/lit.cfg.py
@@ -3,7 +3,6 @@
# Configuration file for the 'lit' test runner.
import os
-import subprocess
import lit.formats
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 646a446c86fdb..04b360e8d3307 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -9,8 +9,6 @@
import subprocess
import sys
-import lit.formats
-
# name: The name of this test suite.
config.name = "lldb-api"
diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index ab6113767187a..02a70c98d86bc 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -7,12 +7,8 @@
import shutil
import site
import subprocess
-import sys
-import lit.formats
from lit.llvm import llvm_config
-from lit.llvm.subst import FindTool
-from lit.llvm.subst import ToolSubst
site.addsitedir(os.path.dirname(__file__))
from helper import toolchain
diff --git a/lldb/test/lit.cfg.py b/lldb/test/lit.cfg.py
index eefc32aabd16d..6a4255c2627d9 100644
--- a/lldb/test/lit.cfg.py
+++ b/lldb/test/lit.cfg.py
@@ -2,9 +2,6 @@
import os
-import lit.formats
-from lit.llvm import llvm_config
-
# This is the top level configuration. Most of these configuration options will
# be overriden by individual lit configuration files in the test
# subdirectories. Anything configured here will *not* be loaded when pointing
diff --git a/llvm/utils/lit/lit/LitConfig.py b/llvm/utils/lit/lit/LitConfig.py
index cb4aef6f72a87..5bb2d3c5c986c 100644
--- a/llvm/utils/lit/lit/LitConfig.py
+++ b/llvm/utils/lit/lit/LitConfig.py
@@ -1,14 +1,12 @@
from __future__ import absolute_import
+
import inspect
import os
-import platform
import sys
-import lit.Test
-import lit.formats
-import lit.TestingConfig
import lit.util
+
# LitConfig must be a new style class for properties to work
class LitConfig(object):
"""LitConfig - Configuration data for a 'lit' test runner instance, shared
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 73db67aedb739..1d3bf8e4e8df1 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1,7 +1,4 @@
from __future__ import absolute_import
-import errno
-import io
-import itertools
import getopt
import os, signal, subprocess, sys
import re
@@ -12,11 +9,8 @@
import shutil
import tempfile
import threading
-import typing
from typing import Optional, Tuple
-import io
-
try:
from StringIO import StringIO
except ImportError:
diff --git a/llvm/utils/lit/lit/discovery.py b/llvm/utils/lit/lit/discovery.py
index 2e7f90c6bb0c9..2e93bacc12368 100644
--- a/llvm/utils/lit/lit/discovery.py
+++ b/llvm/utils/lit/lit/discovery.py
@@ -6,8 +6,8 @@
import os
import sys
+from lit import Test, util
from lit.TestingConfig import TestingConfig
-from lit import LitConfig, Test, util
def chooseConfigFileFromDir(dir, config_names):
diff --git a/llvm/utils/lit/lit/worker.py b/llvm/utils/lit/lit/worker.py
index 8e78bfd45d38b..dbc3ab53bc627 100644
--- a/llvm/utils/lit/lit/worker.py
+++ b/llvm/utils/lit/lit/worker.py
@@ -12,8 +12,6 @@
import traceback
import lit.Test
-import lit.util
-
_lit_config = None
_parallelism_semaphores = None
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/12717 Here is the relevant piece of the build log for the reference
|
Hi, With this patch libcxx/test/libcxx/selftest/dsl/dsl.sh.py fails.
Seen in the build bot in the previous comment as well. |
This reverts commit 26f9161.
I think it's best to revert this patch altogether. There are some implicit imports coming from the LitConfig.py file which I did not anticipate. I will probably open another PR later on which keeps the cleanup to |
Reverts #143930 as it causes build failures: #143930 (comment)
Reverts llvm/llvm-project#143930 as it causes build failures: llvm/llvm-project#143930 (comment)
Reverts llvm/llvm-project#143930 as it causes build failures: llvm/llvm-project#143930 (comment)
Remove imports that are not used in some lit test files.
Reverts llvm#143930 as it causes build failures: llvm#143930 (comment)
Remove imports that are not used in some lit test files.
Reverts llvm#143930 as it causes build failures: llvm#143930 (comment)
Remove imports that are not used in some lit test files.