summaryrefslogtreecommitdiff
path: root/buildstream/_frontend
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-20 22:54:17 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-04-01 10:54:31 +0000
commit438ed34c132c5da29495b92f5589ce8c816cccc3 (patch)
tree347ecfba22106f0d5d8855a431a8d47f5b26e89b /buildstream/_frontend
parentb8cb5832a83d297a6c2feda771ac04cf4fe83874 (diff)
downloadbuildstream-438ed34c132c5da29495b92f5589ce8c816cccc3.tar.gz
lint: Fix or silence 'cyclic-import' errors and enable pylint for it
Cyclic imports can be confusing because the order in which we import dependencies can make the import fail or not. We should not rely on ordering of imports for our code. This fixes everywhere possible the imports and silence explicitely some which are not convenient or would require big refactors
Diffstat (limited to 'buildstream/_frontend')
-rw-r--r--buildstream/_frontend/app.py6
-rw-r--r--buildstream/_frontend/widget.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index ebc05e398..d4ea83871 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -41,7 +41,9 @@ from .. import _yaml
from .._scheduler import ElementJob, JobStatus
# Import frontend assets
-from . import Profile, LogLine, Status
+from .profile import Profile
+from .status import Status
+from .widget import LogLine
# Intendation for all logging
INDENT = 4
@@ -127,7 +129,7 @@ class App():
def create(cls, *args, **kwargs):
if sys.platform.startswith('linux'):
# Use an App with linux specific features
- from .linuxapp import LinuxApp
+ from .linuxapp import LinuxApp # pylint: disable=cyclic-import
return LinuxApp(*args, **kwargs)
else:
# The base App() class is default
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index f092cb5ec..cfe3a06e9 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -26,7 +26,7 @@ import textwrap
from ruamel import yaml
import click
-from . import Profile
+from .profile import Profile
from .. import Element, Consistency, Scope
from .. import _yaml
from .. import __version__ as bst_version