summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2018-12-26 22:35:29 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-12-26 22:35:29 +0000
commit94b9948c459fba61d86c336b0eecf3c385c8625e (patch)
treeebb0fc230c444db639dd32588f31f5a2cfa414d4
parentc3153deaee9257a156bb927555982c5558926527 (diff)
parent61906a14850d0c7ac19b02f9c69c81fc7c025020 (diff)
downloadbuildstream-94b9948c459fba61d86c336b0eecf3c385c8625e.tar.gz
Merge branch 'tristan/test-fixes' into 'master'
Misc fixes to the tests and newer linter errors Closes #636 See merge request BuildStream/buildstream!1011
-rw-r--r--buildstream/_artifactcache/casserver.py2
-rw-r--r--buildstream/_frontend/cli.py3
-rw-r--r--buildstream/_frontend/complete.py2
-rw-r--r--buildstream/_frontend/widget.py2
-rw-r--r--buildstream/_signals.py4
-rw-r--r--buildstream/element.py5
-rw-r--r--buildstream/plugins/elements/import.py2
-rw-r--r--buildstream/source.py1
-rw-r--r--buildstream/storage/_casbaseddirectory.py5
-rw-r--r--dev-requirements.txt6
10 files changed, 11 insertions, 21 deletions
diff --git a/buildstream/_artifactcache/casserver.py b/buildstream/_artifactcache/casserver.py
index ed0266585..2dd30a367 100644
--- a/buildstream/_artifactcache/casserver.py
+++ b/buildstream/_artifactcache/casserver.py
@@ -27,8 +27,8 @@ import uuid
import errno
import threading
-import click
import grpc
+import click
from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc
from .._protos.google.bytestream import bytestream_pb2, bytestream_pb2_grpc
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 26bdf0a92..29fc4cf54 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -673,7 +673,6 @@ def checkout(app, element, location, force, deps, integrate, hardlinks, tar):
@cli.group(short_help="Manipulate sources for an element")
def source():
"""Manipulate sources for an element"""
- pass
##################################################################
@@ -822,7 +821,6 @@ def source_checkout(app, element, location, force, deps, fetch_, except_,
@cli.group(short_help="Manipulate developer workspaces")
def workspace():
"""Manipulate developer workspaces"""
- pass
##################################################################
@@ -1000,7 +998,6 @@ def _classify_artifacts(names, cas, project_directory):
@cli.group(short_help="Manipulate cached artifacts")
def artifact():
"""Manipulate cached artifacts"""
- pass
################################################################
diff --git a/buildstream/_frontend/complete.py b/buildstream/_frontend/complete.py
index d7b7d5b40..1dbdaadb1 100644
--- a/buildstream/_frontend/complete.py
+++ b/buildstream/_frontend/complete.py
@@ -203,7 +203,7 @@ def is_incomplete_option(all_args, cmd_param):
if start_of_option(arg_str):
last_option = arg_str
- return True if last_option and last_option in cmd_param.opts else False
+ return bool(last_option and last_option in cmd_param.opts)
def is_incomplete_argument(current_params, cmd_param):
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index c0c45cec6..a9e5eeafb 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -23,8 +23,8 @@ from contextlib import ExitStack
from mmap import mmap
import re
import textwrap
-import click
from ruamel import yaml
+import click
from . import Profile
from .. import Element, Consistency
diff --git a/buildstream/_signals.py b/buildstream/_signals.py
index 0035485a5..56f70fa7a 100644
--- a/buildstream/_signals.py
+++ b/buildstream/_signals.py
@@ -77,7 +77,7 @@ def terminator(terminate_func):
yield
return
- outermost = False if terminator_stack else True
+ outermost = bool(not terminator_stack)
terminator_stack.append(terminate_func)
if outermost:
@@ -137,7 +137,7 @@ def suspend_handler(sig, frame):
def suspendable(suspend_callback, resume_callback):
global suspendable_stack # pylint: disable=global-statement
- outermost = False if suspendable_stack else True
+ outermost = bool(not suspendable_stack)
suspender = Suspender(suspend_callback, resume_callback)
suspendable_stack.append(suspender)
diff --git a/buildstream/element.py b/buildstream/element.py
index 2b6c68c5d..f0620a57e 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -326,7 +326,6 @@ class Element(Plugin):
*Since: 1.2*
"""
- pass
def assemble(self, sandbox):
"""Assemble the output artifact
@@ -1340,7 +1339,7 @@ class Element(Plugin):
@contextmanager
def _prepare_sandbox(self, scope, directory, shell=False, integrate=True, usebuildtree=False):
# bst shell and bst checkout require a local sandbox.
- bare_directory = True if directory else False
+ bare_directory = bool(directory)
with self.__sandbox(directory, config=self.__sandbox_config, allow_remote=False,
bare_directory=bare_directory) as sandbox:
sandbox._usebuildtree = usebuildtree
@@ -1695,7 +1694,7 @@ class Element(Plugin):
# Store workspaced.yaml
_yaml.dump(_yaml.node_sanitize({
- 'workspaced': True if self._get_workspace() else False
+ 'workspaced': bool(self._get_workspace())
}), os.path.join(metadir, 'workspaced.yaml'))
# Store workspaced-dependencies.yaml
diff --git a/buildstream/plugins/elements/import.py b/buildstream/plugins/elements/import.py
index ec491a0a5..f68537bc6 100644
--- a/buildstream/plugins/elements/import.py
+++ b/buildstream/plugins/elements/import.py
@@ -112,7 +112,7 @@ class ImportElement(BuildElement):
# Ensure target directory parent exists but target directory doesn't
commands.append("mkdir -p {}".format(os.path.dirname(outputdir)))
- commands.append("[ ! -e {} ] || rmdir {}".format(outputdir, outputdir))
+ commands.append("[ ! -e {outputdir} ] || rmdir {outputdir}".format(outputdir=outputdir))
# Move it over
commands.append("mv {} {}".format(inputdir, outputdir))
diff --git a/buildstream/source.py b/buildstream/source.py
index bb54110ca..f5cfeb1dd 100644
--- a/buildstream/source.py
+++ b/buildstream/source.py
@@ -499,7 +499,6 @@ class Source(Plugin):
*Since: 1.4*
"""
- pass
#############################################################
# Public Methods #
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index c8a068d21..d88222273 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -53,12 +53,10 @@ class IndexEntry():
class ResolutionException(VirtualDirectoryError):
""" Superclass of all exceptions that can be raised by
CasBasedDirectory._resolve. Should not be used outside this module. """
- pass
class InfiniteSymlinkException(ResolutionException):
""" Raised when an infinite symlink loop is found. """
- pass
class AbsoluteSymlinkException(ResolutionException):
@@ -66,7 +64,6 @@ class AbsoluteSymlinkException(ResolutionException):
target starts with the path separator) and we have disallowed
following such symlinks.
"""
- pass
class UnexpectedFileException(ResolutionException):
@@ -664,13 +661,11 @@ class CasBasedDirectory(Directory):
""" Sets a static modification time for all regular files in this directory.
Since we don't store any modification time, we don't need to do anything.
"""
- pass
def set_deterministic_user(self):
""" Sets all files in this directory to the current user's euid/egid.
We also don't store user data, so this can be ignored.
"""
- pass
def export_files(self, to_directory, *, can_link=False, can_destroy=False):
"""Copies everything from this into to_directory, which must be the name
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 380e734c8..d967829f7 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,9 +1,9 @@
coverage == 4.4.0
pep8
-pylint == 2.1.1
-pytest >= 3.8
+pylint
+pytest >= 3.9
pytest-cov >= 2.5.0
-pytest-datafiles
+pytest-datafiles >= 2.0
pytest-env
pytest-pep8
pytest-pylint