summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2018-08-29 10:45:33 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-08-29 10:45:33 +0000
commitc5eca59d8ddf29424a185312e4079271f5be530e (patch)
treeeec9027f93223ca7ecceb3005f00b8b2a099f94e
parent7535fda8b3207a6020be3e7aee3337cda7dc6d56 (diff)
parentc6fb5ba71e2be3579ce5d4a512139ee811a04759 (diff)
downloadbuildstream-c5eca59d8ddf29424a185312e4079271f5be530e.tar.gz
Merge branch 'jjardon/pycodestyle_fixes' into 'master'
Some pycodestyle (PEP8) fixes See merge request BuildStream/buildstream!746
-rw-r--r--buildstream/plugins/sources/tar.py6
-rw-r--r--buildstream/plugins/sources/zip.py4
-rw-r--r--buildstream/utils.py1
-rwxr-xr-xdoc/bst2html.py5
-rw-r--r--doc/source/conf.py6
-rw-r--r--tests/cachekey/cachekey.py1
-rwxr-xr-xtests/cachekey/update.py1
-rw-r--r--tests/frontend/buildcheckout.py1
8 files changed, 15 insertions, 10 deletions
diff --git a/buildstream/plugins/sources/tar.py b/buildstream/plugins/sources/tar.py
index e32cc3dc8..7814679c7 100644
--- a/buildstream/plugins/sources/tar.py
+++ b/buildstream/plugins/sources/tar.py
@@ -127,7 +127,7 @@ class TarSource(DownloadableFileSource):
if not base_dir.endswith(os.sep):
base_dir = base_dir + os.sep
- l = len(base_dir)
+ L = len(base_dir)
for member in tar.getmembers():
# First, ensure that a member never starts with `./`
@@ -145,9 +145,9 @@ class TarSource(DownloadableFileSource):
# base directory.
#
if member.type == tarfile.LNKTYPE:
- member.linkname = member.linkname[l:]
+ member.linkname = member.linkname[L:]
- member.path = member.path[l:]
+ member.path = member.path[L:]
yield member
# We want to iterate over all paths of a tarball, but getmembers()
diff --git a/buildstream/plugins/sources/zip.py b/buildstream/plugins/sources/zip.py
index d3ce0f16d..0bbb2cd27 100644
--- a/buildstream/plugins/sources/zip.py
+++ b/buildstream/plugins/sources/zip.py
@@ -121,13 +121,13 @@ class ZipSource(DownloadableFileSource):
if not base_dir.endswith(os.sep):
base_dir = base_dir + os.sep
- l = len(base_dir)
+ L = len(base_dir)
for member in archive.infolist():
if member.filename == base_dir:
continue
if member.filename.startswith(base_dir):
- member.filename = member.filename[l:]
+ member.filename = member.filename[L:]
yield member
# We want to iterate over all paths of an archive, but namelist()
diff --git a/buildstream/utils.py b/buildstream/utils.py
index 943346689..3d8bd62ca 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -645,6 +645,7 @@ def _pretty_size(size, dec_places=0):
psize /= 1024
return "{size:g}{unit}".format(size=round(psize, dec_places), unit=unit)
+
# A sentinel to be used as a default argument for functions that need
# to distinguish between a kwarg set to None and an unset kwarg.
_sentinel = object()
diff --git a/doc/bst2html.py b/doc/bst2html.py
index 47ea662b5..eaf25eae8 100755
--- a/doc/bst2html.py
+++ b/doc/bst2html.py
@@ -96,8 +96,8 @@ def _ansi2html_get_styles(palette):
for g in range(24):
i = g + 232
- l = g * 10 + 8
- indexed_style['%s' % i] = ''.join('%02X' % c if 0 <= c <= 255 else None for c in (l, l, l))
+ L = g * 10 + 8
+ indexed_style['%s' % i] = ''.join('%02X' % c if 0 <= c <= 255 else None for c in (L, L, L))
_ANSI2HTML_STYLES[palette] = (regular_style, bold_style, indexed_style)
return _ANSI2HTML_STYLES[palette]
@@ -455,6 +455,7 @@ def run_bst(directory, force, source_cache, description, palette):
return 0
+
if __name__ == '__main__':
try:
run_bst()
diff --git a/doc/source/conf.py b/doc/source/conf.py
index e95a114e1..60477bbd5 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -19,10 +19,10 @@
#
import os
import sys
-sys.path.insert(0, os.path.abspath('..'))
-
from buildstream import __version__
+sys.path.insert(0, os.path.abspath('..'))
+
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@@ -112,7 +112,7 @@ add_module_names = False
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
-modindex_common_prefix = [ 'buildstream.' ]
+modindex_common_prefix = ['buildstream.']
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index 21beef8fb..b1f8a9140 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -129,6 +129,7 @@ def assert_cache_keys(project_dir, output):
"Use tests/cachekey/update.py to automatically " +
"update this test case")
+
##############################################
# Test Entry Point #
##############################################
diff --git a/tests/cachekey/update.py b/tests/cachekey/update.py
index 09cf19657..8cbee444d 100755
--- a/tests/cachekey/update.py
+++ b/tests/cachekey/update.py
@@ -65,5 +65,6 @@ def update_keys():
write_expected_key(element_name, actual_keys[element_name])
+
if __name__ == '__main__':
update_keys()
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index d0f52d6a7..4d409cdfe 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -288,6 +288,7 @@ def test_build_checkout_force_tarball(datafiles, cli):
assert os.path.join('.', 'usr', 'bin', 'hello') in tar.getnames()
assert os.path.join('.', 'usr', 'include', 'pony.h') in tar.getnames()
+
fetch_build_checkout_combos = \
[("strict", kind) for kind in ALL_REPO_KINDS] + \
[("non-strict", kind) for kind in ALL_REPO_KINDS]