-
276d2195
by Angelos Evripiotis
at 2018-10-25T10:17:49Z
_downloadablefilesource: handle ValueError-s
-
2d012a21
by Angelos Evripiotis
at 2018-10-25T10:17:49Z
Merge branch 'aevri/unknown-uri-452' into 'master'
_downloadablefilesource: handle ValueError-s
Closes #452
See merge request BuildStream/buildstream!893
-
29ac3116
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_context.py: Remove useless `return` from `Context.message`
This pointless bare `return` was causing modern pylint to raise an
error.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
ba563c13
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_variables.py: Fix lint issue in `find_recursive_variable`
The python `for`/`else` construct only makes sense if the `for` loop body
has a `break` statement. Otherwise the use of `else` causes pylint
to raise an error.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
5693f557
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_workspaces.py: Simplify chained comparison
In `_parse_workspace_config` there was a chained version comparison
which is simplified in this commit to quieten a pylint issue.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
aba9beef
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_yaml.py: use `in (a,b)` to simply boolean checks
Where we use a construct `val == foo or val == bar` we can instead use
`val in (foo, bar)` which pylint prefers.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
39ae2e29
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_yaml.py: Quieten a lint in Python < 3.6
For Python before 3.6, `path.resolve()` could not take the `strict`
keyword argument. Linting on such Python versions will raise an unnecessary
issue given the check present. As such, quieten that lint.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
40b21838
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_yamlcache.py: Correct bug in `YamlCache._get_filepath()`
The correct file path was computed but never returned. This was
never caught because of a test missing consumption of one of its
parameters. This commit resolves the bug mentioned in #722 leaving
the test to be amended by a future commit.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
93caa9c0
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_yamlcache.py: Correct braino in variable name
This braino would mean that we'd fail to raise the right exception
if we failed to find the right project object when unpickling the
yaml cache.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
13f7ab91
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_yamlcache.py: Remove unused imports
The imports of _cachekey and utils were unused.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
041a82a6
by Daniel Silverstone
at 2018-10-25T12:58:08Z
buildelement.py: Quieten a lint about `__commands`
Unfortunately elements don't override `__init__` in general, so
we have to quieten pylint here.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
32facce2
by Daniel Silverstone
at 2018-10-25T12:58:08Z
element.py: Simplify some conditions with `in (foo, bar)`
Where we have conditions of the form `var == foo or var == bar` it
can be simplified to `var in (foo, bar)` which pylint prefers.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
b304a730
by Daniel Silverstone
at 2018-10-25T12:58:08Z
element.py: Silence pylint warning about abstract method
Unfortunately pylint can't understand that we'll always use subclasses
of Element and as such complains of a no-return function (`assemble()`)
having its return value used. This quietens that warning.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
859a0169
by Daniel Silverstone
at 2018-10-25T12:58:08Z
plugin.py: use dict.get() instead of an if statement
Pylint recommends the use of dict.get() rather than a multi-line if
statement for handling optional keyword arguments.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
f8366d13
by Daniel Silverstone
at 2018-10-25T12:58:08Z
source.py: Quiet several pylint issues with abstract methods
A number of times, abstract methods are called which pylint cannot
possibly understand will only ever happen in subclasses which implement
the abstract methods. This silences those specific warnings
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
51ad79d8
by Daniel Silverstone
at 2018-10-25T12:58:08Z
source.py: Remove unused local variable
Remove `source_kind` as it was unused.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
25afa379
by Daniel Silverstone
at 2018-10-25T12:58:08Z
source.py: Remove unused variable
Remove the `context` variable which was unused.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
7cc7e61b
by Daniel Silverstone
at 2018-10-25T12:58:08Z
utils.py: Disable lint warning about popen
We use `preexec_fn` in our use of Popen. Since there are threads
in the codebase, this is not necessarily safe. However we go to
great lengths to ensure that the main process doesn't spawn threads
(they're used in gRPC a lot) and so it should be safe for our use.
As such, we disable the lint here.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
0913cac1
by Daniel Silverstone
at 2018-10-25T12:58:08Z
utils.py: Group stat imports
The imports of `stat` and `S_ISDIR` from `stat` should be grouped to
satisfy pylint.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
7e8e1d39
by Daniel Silverstone
at 2018-10-25T12:58:08Z
_artifactcache/artifactcache.py: Remove superfluous parens
The pylint report dislikes the superfluous parens which used to
be here in this assert.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
5dd23ca9
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_artifactcache/artifactcache.py: Silence lint issues
The pylint tool is unable to understand that the abstract methods
in the artifact cache will only be called when there's concrete
implementations behind them. Silence the lint errors for these
specific calls.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
67eda614
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_frontend/app.py: Remove unused import of `resource`
The `resource` import was unused. Removed.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
d2b43b85
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_frontend/status.py: Reorder imports
The `curses` import is "standard" whereas `click` is not. As such, despite
alphabetical order normally being the rule, `curses` must come before `click`.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
0243ccec
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_fuse/{hardlinks,mount}.py: Remove dangerous use of {} in defaults
Since default values in arguments to functions and methods are created once
at the compilation of the code, it is dangerous to include list and dict
literals in them. This changes the use of {} to None.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
f65b0262
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_fuse/mount.py: Deal with abstract method lint issue
Unfortunately pylint can't tell this is an abstract method which will
only ever end up invoked from a class which concretises it. As such
we need to silence this warning.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
e2b598e6
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_options/optionbool.py: Refactor conditions
The pylint tool prefers that conditions of the form "var == foo or var == bar"
be refactored into "var in (foo, bar)".
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
e394b140
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_platform/darwin.py: Remove useless __init__()
An otherwise empty __init__ passing no arguments to super.__init__
is worthless. Remove it.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
29df292e
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_platform/darwin.py: Remove unused imports
The import of `resource` was unused.
The import of `PlatformError` was unused.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
62275fce
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_platform/linux.py: Remove unused imports
The imports of `Message` and `MessageType` were unused.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
8e4b6ef4
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_platform/linux.py: Simplify return statement
The linter dislikes an if/return/else/return where it can be
simplified to a return of the if condition.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
53779010
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_scheduler/jobs/job.py: Correct lint issue around abstract method
The linter cannot detect abstract methods the way we use them, so
this silences the warning which ensues.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
285ebaa7
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_scheduler/queue/pullqueue.py: Remove unused return value
The `done()` method does not return anything anywhere else.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
77106ce4
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_scheduler/queue/trackqueue.py: Remove unused import
The `SourceError` import was never used
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
6b9d9e5f
by Daniel Silverstone
at 2018-10-25T12:58:09Z
plugins/source/git.py: Rationalised unused return values
The `assert_ref_in_track()` method's return value was never used so
rationalise it to never return a value.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
aa650bb2
by Daniel Silverstone
at 2018-10-25T12:58:09Z
sandbox/_mount.py: Do not use dict literals in argument defaults
The use of dictionary literals in argument defaults is disrecommended
due to the way that they are static and thus potentially very confusing.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
f09179b8
by Daniel Silverstone
at 2018-10-25T12:58:09Z
sandbox/_mounter.py: Remove useless inheritance on `object`
In Python 3, inheriting from `object` explicitly is pointless.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
daa80231
by Daniel Silverstone
at 2018-10-25T12:58:09Z
sandbox/_sandboxbwrap.py: Disable lint about dict.get
Sometimes `dict.get()` is preferable, in this instance it's less clear
so we'll disable that lint
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
91afae39
by Daniel Silverstone
at 2018-10-25T12:58:09Z
sandbox/_sandboxchroot.py: Silence warning about unused variable
The variable was unused, remove it.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
cc2b299e
by Daniel Silverstone
at 2018-10-25T12:58:09Z
sandbox/_sandboxchroot.py: Silence warning about preexec_fn
We are super-careful to not use threads in places where we might use
Popen and as such this warning is save to quash.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
39a7b5f7
by Daniel Silverstone
at 2018-10-25T12:58:09Z
sandbox/_sandboxchroot.py: Silence warning about dict.get
Sometimes `dict.get()` is preferable to an `if` statement, but this time
it's clearer if we keep the structure. As such, silence the warning.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
6e539889
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_artifactcache/cascache.py: Refactor slightly for indentation
Correct some multi-line conditional indentation by slight refactor
if necessary.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
21e3f036
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_artifactcache/cascache.py: Silence len(SEQUENCE) as condition warnings
The lint tool dislikes the use of `if len(SEQ) == 0` type statements
because nominally `len(SEQ)` may be more expensive than `bool(SEQ)`.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
50fd1480
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_artifactcache/cascache.py: Prepare attributes in __init__
Python linters prefer that attributes are defined in __init__ rather
than left to later routines.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
a9489c8e
by Daniel Silverstone
at 2018-10-25T12:58:09Z
_artifactcache/cascache.py: Remove unused imports
The imports of `Message` and `MessageType` were unused.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
598c04b0
by Daniel Silverstone
at 2018-10-25T12:58:10Z
_artifactcache/cascache.py: Cleanup lint warning about indexing
In order to quieten the linter, and to make a more correct comparison,
we switch to using the `Code.OK` enumeration from `google.rpc.Code`
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>
-
1d8fe381
by Tristan Maat
at 2018-10-25T12:58:10Z
Bump CI image tags
We need to do this so that the new linting errors pop up
-
4247cef3
by Daniel Silverstone
at 2018-10-25T12:58:10Z
MANIFEST: Include a lot more missing stuff in the manifest
Versioneer needs to be in the MANIFEST.in and its .pyc needs to be ignored
in the .gitignore. Also much docs were not being included, nor conftest.py.
Much of the test suite data files needed including, so changed that to a
raw include of everything in the tests/ tree.
Signed-off-by: Daniel Silverstone <daniel silverstone codethink co uk>