diff options
28 files changed, 42 insertions, 83 deletions
diff --git a/buildstream/_artifactcache/pushreceive.py b/buildstream/_artifactcache/pushreceive.py index 4df5bbe49..4d85627a7 100644 --- a/buildstream/_artifactcache/pushreceive.py +++ b/buildstream/_artifactcache/pushreceive.py @@ -24,10 +24,8 @@ import logging import os import subprocess import sys -import tempfile import shutil import tarfile -import signal import tempfile from enum import Enum from urllib.parse import urlparse diff --git a/buildstream/_artifactcache/tarcache.py b/buildstream/_artifactcache/tarcache.py index 90821874e..1c675e9a2 100644 --- a/buildstream/_artifactcache/tarcache.py +++ b/buildstream/_artifactcache/tarcache.py @@ -25,7 +25,6 @@ import subprocess from .. import utils from ..element import _KeyStrength -from .._message import Message, MessageType from .._exceptions import ArtifactError, ProgramNotFoundError from . import ArtifactCache diff --git a/buildstream/_context.py b/buildstream/_context.py index 5fd4a428e..f975d3d55 100644 --- a/buildstream/_context.py +++ b/buildstream/_context.py @@ -19,8 +19,6 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> import os -import hashlib -import pickle from collections import deque, Mapping from . import _site from . import _yaml diff --git a/buildstream/_frontend/complete.py b/buildstream/_frontend/complete.py index 6294e6eae..346ee7859 100644 --- a/buildstream/_frontend/complete.py +++ b/buildstream/_frontend/complete.py @@ -20,13 +20,10 @@ import collections import copy import os -import sys -import re -import click -from click.parser import split_arg_string +import click from click.core import MultiCommand, Option, Argument - +from click.parser import split_arg_string WORDBREAK = '=' diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py index e14c53eaf..7e1b0cc18 100644 --- a/buildstream/_frontend/main.py +++ b/buildstream/_frontend/main.py @@ -26,7 +26,7 @@ from blessings import Terminal from click import UsageError # Import buildstream public symbols -from .. import Scope, Consistency +from .. import Scope # Import various buildstream internals from .._context import Context diff --git a/buildstream/_frontend/status.py b/buildstream/_frontend/status.py index a0135ac1e..caaa8a363 100644 --- a/buildstream/_frontend/status.py +++ b/buildstream/_frontend/status.py @@ -17,7 +17,6 @@ # # Authors: # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> -import datetime import click from blessings import Terminal diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py index 1d7a5ecc8..ccda68b6b 100644 --- a/buildstream/_frontend/widget.py +++ b/buildstream/_frontend/widget.py @@ -17,22 +17,22 @@ # # Authors: # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> -import os -import click -import subprocess import datetime -import pkg_resources +import os from collections import OrderedDict from contextlib import ExitStack -from ruamel import yaml from mmap import mmap -from .. import utils, _yaml -from ..plugin import _plugin_lookup -from .._message import MessageType -from .._exceptions import ImplError -from .. import Element, Scope, Consistency +import click +import pkg_resources +from ruamel import yaml + from . import Profile +from .. import Element, Scope, Consistency +from .. import _yaml +from .._exceptions import ImplError +from .._message import MessageType +from ..plugin import _plugin_lookup # Widget() diff --git a/buildstream/_fuse/hardlinks.py b/buildstream/_fuse/hardlinks.py index 0deb6f2f8..d23f3fff6 100644 --- a/buildstream/_fuse/hardlinks.py +++ b/buildstream/_fuse/hardlinks.py @@ -22,15 +22,12 @@ # The filesystem operations implementation here is based # on some example code written by Stavros Korokithakis. -import os -import sys -import stat import errno +import os import shutil -import signal +import stat import tempfile -from multiprocessing import Process from .fuse import FuseOSError, Operations from .mount import Mount diff --git a/buildstream/_loader.py b/buildstream/_loader.py index d96a1f2c6..a8ab4019f 100644 --- a/buildstream/_loader.py +++ b/buildstream/_loader.py @@ -19,13 +19,11 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> import os -import copy from functools import cmp_to_key from collections import Mapping, namedtuple from ._exceptions import LoadError, LoadErrorReason from . import _yaml -from ._yaml import CompositeTypeError from ._metaelement import MetaElement from ._metasource import MetaSource diff --git a/buildstream/_options/optionarch.py b/buildstream/_options/optionarch.py index 9cadbebba..2ced60935 100644 --- a/buildstream/_options/optionarch.py +++ b/buildstream/_options/optionarch.py @@ -19,7 +19,6 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> import os -from .option import OPTION_SYMBOLS from .optionenum import OptionEnum diff --git a/buildstream/_options/optioneltmask.py b/buildstream/_options/optioneltmask.py index 765c50d10..46c7fcd62 100644 --- a/buildstream/_options/optioneltmask.py +++ b/buildstream/_options/optioneltmask.py @@ -19,7 +19,6 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> from .. import utils -from .option import OPTION_SYMBOLS from .optionflags import OptionFlags diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py index e541cb432..69256bb5a 100644 --- a/buildstream/_ostree.py +++ b/buildstream/_ostree.py @@ -23,9 +23,6 @@ # Code based on Jürg's artifact cache and Andrew's ostree plugin # import os -import subprocess -from . import _site -from . import utils from ._exceptions import BstError import gi diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py index f182cce3b..26e79cc5f 100644 --- a/buildstream/_pipeline.py +++ b/buildstream/_pipeline.py @@ -19,7 +19,6 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> # Jürg Billeter <juerg.billeter@codethink.co.uk> -import datetime import os import stat import shlex @@ -38,9 +37,8 @@ from ._sourcefactory import SourceFactory from . import Consistency from . import Scope from . import _site -from . import _yaml, utils +from . import utils from ._platform import Platform -from .element import Element from ._scheduler import SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py index cab9aa996..265352561 100644 --- a/buildstream/_platform/linux.py +++ b/buildstream/_platform/linux.py @@ -18,15 +18,12 @@ # Authors: # Tristan Maat <tristan.maat@codethink.co.uk> -import os -import sys import subprocess from .. import utils -from .._exceptions import PlatformError +from .._artifactcache.ostreecache import OSTreeCache from .._message import Message, MessageType from ..sandbox import SandboxBwrap -from .._artifactcache.ostreecache import OSTreeCache from . import Platform diff --git a/buildstream/_platform/platform.py b/buildstream/_platform/platform.py index 0f3007cd9..304aa4bba 100644 --- a/buildstream/_platform/platform.py +++ b/buildstream/_platform/platform.py @@ -20,10 +20,8 @@ import os import sys -import platform -from .. import utils -from .._exceptions import PlatformError, ProgramNotFoundError, ImplError +from .._exceptions import PlatformError, ImplError class Platform(): diff --git a/buildstream/_platform/unix.py b/buildstream/_platform/unix.py index c9d67d2bc..a34938a98 100644 --- a/buildstream/_platform/unix.py +++ b/buildstream/_platform/unix.py @@ -20,10 +20,9 @@ import os -from .. import utils +from .._artifactcache.tarcache import TarCache from .._exceptions import PlatformError from ..sandbox import SandboxChroot -from .._artifactcache.tarcache import TarCache from . import Platform diff --git a/buildstream/_scheduler/pushqueue.py b/buildstream/_scheduler/pushqueue.py index 63cfd839c..6ffaf7949 100644 --- a/buildstream/_scheduler/pushqueue.py +++ b/buildstream/_scheduler/pushqueue.py @@ -19,9 +19,6 @@ # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> # Jürg Billeter <juerg.billeter@codethink.co.uk> -# BuildStream toplevel imports -from .. import Consistency - # Local imports from . import Queue, QueueType diff --git a/buildstream/_scheduler/scheduler.py b/buildstream/_scheduler/scheduler.py index f5f0664c1..f8852e1f8 100644 --- a/buildstream/_scheduler/scheduler.py +++ b/buildstream/_scheduler/scheduler.py @@ -26,10 +26,7 @@ import signal import datetime # Local imports -from .queue import Queue, QueueType - -# BuildStream toplevel imports -from .. import _signals +from .queue import QueueType # A decent return code for Scheduler.run() diff --git a/buildstream/_scheduler/trackqueue.py b/buildstream/_scheduler/trackqueue.py index df73a7280..404813f38 100644 --- a/buildstream/_scheduler/trackqueue.py +++ b/buildstream/_scheduler/trackqueue.py @@ -23,7 +23,6 @@ import os # BuildStream toplevel imports -from .. import Consistency from ..plugin import _plugin_lookup from .. import _yaml diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py index 376d3dd7e..8e51050c3 100644 --- a/buildstream/_yaml.py +++ b/buildstream/_yaml.py @@ -21,7 +21,6 @@ import sys import collections import copy -from enum import Enum from contextlib import ExitStack from ruamel import yaml diff --git a/buildstream/plugin.py b/buildstream/plugin.py index 35b116dfe..fa1cb03a1 100644 --- a/buildstream/plugin.py +++ b/buildstream/plugin.py @@ -67,11 +67,9 @@ Class Reference --------------- """ -import os import datetime +import os import subprocess -import signal -import sys from contextlib import contextmanager from weakref import WeakValueDictionary diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py index c1e40e506..093f37dba 100644 --- a/buildstream/plugins/sources/git.py +++ b/buildstream/plugins/sources/git.py @@ -57,13 +57,13 @@ """ import os -import tempfile -import shutil import re +import shutil from collections import Mapping -from configparser import RawConfigParser from io import StringIO +from configparser import RawConfigParser + from buildstream import Source, SourceError, Consistency from buildstream import utils diff --git a/buildstream/plugins/sources/ostree.py b/buildstream/plugins/sources/ostree.py index 6f2562fc0..d0b3c1807 100644 --- a/buildstream/plugins/sources/ostree.py +++ b/buildstream/plugins/sources/ostree.py @@ -49,12 +49,11 @@ """ import os -import tempfile import shutil from buildstream import Source, SourceError, Consistency -from buildstream import utils from buildstream import _ostree +from buildstream import utils from buildstream._ostree import OSTreeError diff --git a/buildstream/plugins/sources/tar.py b/buildstream/plugins/sources/tar.py index 8af1d5084..f432a5148 100644 --- a/buildstream/plugins/sources/tar.py +++ b/buildstream/plugins/sources/tar.py @@ -51,7 +51,7 @@ import tarfile from contextlib import contextmanager, ExitStack from tempfile import TemporaryFile -from buildstream import Source, SourceError +from buildstream import SourceError from buildstream import utils from ._downloadablefilesource import DownloadableFileSource diff --git a/buildstream/plugins/sources/zip.py b/buildstream/plugins/sources/zip.py index 495aa6d00..b39923df5 100644 --- a/buildstream/plugins/sources/zip.py +++ b/buildstream/plugins/sources/zip.py @@ -50,7 +50,7 @@ import os import zipfile -from buildstream import Source, SourceError +from buildstream import SourceError from buildstream import utils from ._downloadablefilesource import DownloadableFileSource diff --git a/buildstream/source.py b/buildstream/source.py index 71aa7e358..cd78890f6 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -23,13 +23,11 @@ Source """ import os -import tempfile -import shutil from contextlib import contextmanager -from . import _yaml, _signals, utils -from ._exceptions import BstError, ImplError, LoadError, LoadErrorReason from . import Plugin +from . import _yaml, utils +from ._exceptions import BstError, ImplError, LoadError, LoadErrorReason class Consistency(): diff --git a/buildstream/utils.py b/buildstream/utils.py index 7cb21825e..b04ce408c 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -22,25 +22,26 @@ Utilities ========= """ -import os +import calendar import errno -import stat -import shutil -import string -import collections import hashlib +import os import pickle -import calendar -import psutil -import subprocess -import signal import re +import shutil +import signal +import stat +import string +import subprocess import tempfile -import pkg_resources from contextlib import contextmanager -from ._exceptions import ProgramNotFoundError -from . import _yaml + +import pkg_resources +import psutil + from . import _signals +from . import _yaml +from ._exceptions import ProgramNotFoundError class FileListResult(): @@ -21,8 +21,6 @@ import os import shutil import sys -from setuptools import setup -from setuptools.command.install import install if sys.version_info[0] != 3 or sys.version_info[1] < 4: print("BuildStream requires Python >= 3.4") |