diff --git a/.ci/lib/stage-lint.jenkinsfile b/.ci/lib/stage-lint.jenkinsfile index 53d3712b..fc13ab11 100644 --- a/.ci/lib/stage-lint.jenkinsfile +++ b/.ci/lib/stage-lint.jenkinsfile @@ -2,8 +2,7 @@ stage('lint') { sh ''' if .ci/isdistro bionic then - ./.ci/run-pylint -f text || : - ./.ci/run-pylint -f json | ./.ci/prfilter + ./.ci/run-pylint -f text fi ./.ci/run-shellcheck ''' diff --git a/.ci/prfilter b/.ci/prfilter deleted file mode 100755 index 44ac7b00..00000000 --- a/.ci/prfilter +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 - -import collections -import json -import pathlib -import subprocess -import sys - -DEFAULT_REF = 'origin/master' - -THE_BIG_LIST_OF_NAUGHTY_FILES = list(map(pathlib.Path, [ - # - # Problems with files listed here get lighter treatment: they are blocking - # only when they are a part of the current pull request. - # - - 'Documentation/conf.py', - 'LibOS/shim/test/ltp/contrib/conf_lint.py', - 'LibOS/shim/test/ltp/contrib/conf_merge.py', - 'LibOS/shim/test/ltp/contrib/conf_missing.py', - 'LibOS/shim/test/ltp/contrib/conf_remove_must_pass.py', - 'LibOS/shim/test/ltp/contrib/has_own_main.py', - 'LibOS/shim/test/ltp/contrib/report.py', - 'LibOS/shim/test/ltp/runltp_xml.py', - 'Examples/python-scipy-insecure/scripts/test-numpy.py', - 'Examples/python-scipy-insecure/scripts/test-scipy.py', - 'Examples/python-simple/scripts/benchrun.py', - 'Examples/python-simple/scripts/dummy-web-server.py', - 'Examples/python-simple/scripts/fibonacci.py', - 'Examples/python-simple/scripts/helloworld.py', - 'Examples/python-simple/scripts/test-http.py', - 'LibOS/shim/test/fs/test_fs.py', - 'LibOS/shim/test/regression/test_libos.py', - 'Pal/regression/test_pal.py', - 'Pal/src/host/Linux-SGX/sgx-driver/link-intel-driver.py', - 'Scripts/regression.py', - 'Tools', -])) - -def get_diff_ranges(ref=DEFAULT_REF): - '''Get chunks affected by a merge request - - Args: - ref (str): a reference to diff the HEAD against (default: origin/master) - - Returns: - dict: a dict with filenames in keys and list of `(start, end)` ranges in - values (start is inclusive, end is not, wrt :py:func:`range`) - ''' - files = collections.defaultdict(list) - data = subprocess.check_output(['git', 'diff', '-U0', ref, 'HEAD']).decode() - path = None - - for line in data.split('\n'): - if line.startswith('+++ '): - path = (None if line == '+++ /dev/null' - else line.split('/', maxsplit=1)[-1]) - continue - if line.startswith('@@ '): - # @@ -8,0 +9 @@ [class name or previous line or whatever] - if path is None: # /dev/null - continue - _, _, plus, *_ = line.split() - start, length, *_ = *(int(i) for i in plus[1:].split(',')), 1 - if not length: - # remove-only chunk - continue - files[path].append((start, start + length)) - - return files - -class Diff: - '''A quick and dirty diff evaluator - - >>> diff = Diff() - >>> (message['file'], message['line']) in diff - True # or False - >>> diff.message_is_important(message) - True # or False - - The default diff is to the ``origin/master`` ref. - ''' - # pylint: disable=too-few-public-methods - - def __init__(self, ref=DEFAULT_REF): - self._files = get_diff_ranges(ref) - - def __contains__(self, pathline): - path, line = pathline - try: - return any(start <= line < end for start, end in self._files[path]) - except KeyError: - return False - - @staticmethod - def message_is_important(message): - path = pathlib.Path(message['path']) - for i in THE_BIG_LIST_OF_NAUGHTY_FILES: - try: - path.relative_to(i) - break - except ValueError: - # path is not .relative_to() the path from WHITELIST - pass - else: - # not on whitelist: always complain - return True - - # on whitelist: don't complain - return False - -def main(): - diff = Diff() - with sys.stdin: - pylint = json.load(sys.stdin) - - ret = 0 - for message in pylint: - # shellcheck - if 'path' not in message: - message['path'] = message['file'] - if 'symbol' not in message: - message['symbol'] = message['code'] - - if diff.message_is_important(message): - if not ret: - print('MESSAGES AFFECTING THIS PR:') - print('{path} +{line}:{column}: {symbol}: {message}'.format( - **message)) - ret += 1 - - return min(ret, 255) - -if __name__ == '__main__': - sys.exit(main()) diff --git a/.ci/run-pylint b/.ci/run-pylint index 64d1f126..21cf0df1 100755 --- a/.ci/run-pylint +++ b/.ci/run-pylint @@ -18,8 +18,8 @@ find . -name \*.py \ -and -not -path ./LibOS/shim/test/ltp/build/\* \ -and -not -path ./LibOS/shim/test/ltp/install/\* \ -and -not -path ./Examples/pytorch/\* \ + -and -not -path ./Pal/src/host/Linux-SGX/sgx-driver/\* \ | sed 's/./\\&/g' \ | xargs "${PYLINT}" "$@" \ Pal/src/host/Linux-SGX/signer/pal-sgx-get-token \ - Pal/src/host/Linux-SGX/signer/pal-sgx-sign \ - .ci/prfilter + Pal/src/host/Linux-SGX/signer/pal-sgx-sign diff --git a/.pylintrc b/.pylintrc index 90d9a48d..0be2c95e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -4,6 +4,7 @@ # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code. extension-pkg-whitelist= + numpy # Add files or directories to the blacklist. They should be base names, not # paths. @@ -53,9 +54,21 @@ confidence= enable=* disable= + bad-option-value, # for compatibility between different pylint versions bad-continuation, c-extension-no-member, missing-docstring, + missing-function-docstring, + missing-module-docstring, + invalid-name, + fixme, + raise-missing-from, + too-many-instance-attributes, + too-many-branches, + too-many-statements, + too-few-public-methods, + too-many-public-methods, + no-self-use [REPORTS] @@ -421,7 +434,10 @@ int-import-graph= known-standard-library= # Force import order to recognize a module as part of a third party library. -known-third-party=enchant +known-third-party= + enchant, + docker, + yaml [CLASSES] diff --git a/Examples/python-scipy-insecure/scripts/test-numpy.py b/Examples/python-scipy-insecure/scripts/test-numpy.py index d0c9ac72..5c25eb3b 100644 --- a/Examples/python-scipy-insecure/scripts/test-numpy.py +++ b/Examples/python-scipy-insecure/scripts/test-numpy.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -import numpy -import sys import timeit +import numpy + try: import numpy.core._dotblas except ImportError: @@ -11,9 +11,9 @@ except ImportError: print("numpy version: " + numpy.__version__) -x = numpy.random.random((1000,1000)) +x = numpy.random.random((1000, 1000)) -setup = "import numpy; x = numpy.random.random((1000,1000))" +setup = "import numpy; x = numpy.random.random((1000, 1000))" count = 5 t = timeit.Timer("numpy.dot(x, x.T)", setup=setup) diff --git a/Examples/python-simple/scripts/benchrun.py b/Examples/python-simple/scripts/benchrun.py index 43570022..cd9a90bf 100644 --- a/Examples/python-simple/scripts/benchrun.py +++ b/Examples/python-simple/scripts/benchrun.py @@ -11,26 +11,27 @@ See fibonacci.py for example. import sys if sys.platform == 'win32': - from time import clock + from time import clock # pylint: disable=no-name-in-module,unused-import else: - from time import time as clock + from time import time as clock # pylint: disable=unused-import # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302478 def combinations(*seqin): - def rloop(seqin,comb): + def rloop(seqin, comb): if seqin: for item in seqin[0]: newcomb = comb + [item] - for item in rloop(seqin[1:],newcomb): - yield item + for item2 in rloop(seqin[1:], newcomb): + yield item2 else: yield comb - return rloop(seqin,[]) + return rloop(seqin, []) class Benchmark: sort_by = [] reference = None + parameters = {} def __init__(self): self.pnames = [] @@ -43,6 +44,7 @@ class Benchmark: self.pvalues.append(value) self.pcombos = list(combinations(*self.pvalues)) if self.reference: + # pylint: disable=unsubscriptable-object self.reference_param = self.reference[0] self.reference_value = self.reference[1] @@ -50,6 +52,7 @@ class Benchmark: """Run benchmark for all versions and parameters.""" for params in self.pcombos: args = dict(zip(self.pnames, params)) + # pylint: disable=no-member t = self.run(**args) self.results.append(tuple(params) + (t,)) self.results_dict[tuple(params)] = t @@ -72,10 +75,10 @@ class Benchmark: i = self.pnames.index(self.reference_param) if pvalues[i] == self.reference_value: return None - else: - pvalues[i] = self.reference_value + + pvalues[i] = self.reference_value ref = self.results_dict[tuple(pvalues)] - if ref == None: + if ref is None: return None return ref / time @@ -91,7 +94,6 @@ class Benchmark: print(self.__doc__ + "\n") colwidth = 15 - reftimes = {} ts = "seconds" if self.reference: @@ -99,16 +101,15 @@ class Benchmark: print(" " + " ".join([str(r).ljust(colwidth) for r in self.pnames + [ts]])) print("-" * 79) - rows = [] for vals in self.results: - pvalues = vals[:-1] + pvalues = vals[:-1] time = vals[-1] - if time == None: + if time is None: stime = "(n/a)" else: stime = "%.8f" % time factor = self.get_factor(pvalues, time) - if factor != None: + if factor is not None: stime += (" (%.2f)" % factor) vals = pvalues + (stime,) row = [str(val).ljust(colwidth) for val in vals] diff --git a/Examples/python-simple/scripts/dummy-web-server.py b/Examples/python-simple/scripts/dummy-web-server.py index 1aa21d4a..88d5a171 100644 --- a/Examples/python-simple/scripts/dummy-web-server.py +++ b/Examples/python-simple/scripts/dummy-web-server.py @@ -19,7 +19,6 @@ Send a POST request:: """ from http.server import BaseHTTPRequestHandler, HTTPServer -import socketserver class S(BaseHTTPRequestHandler): def _set_headers(self): diff --git a/Examples/python-simple/scripts/fibonacci.py b/Examples/python-simple/scripts/fibonacci.py index ee5b6bf1..70314a84 100644 --- a/Examples/python-simple/scripts/fibonacci.py +++ b/Examples/python-simple/scripts/fibonacci.py @@ -15,7 +15,7 @@ def fib2(n): if n < 2: return n a, b = 1, 0 - for i in range(n-1): + for _ in range(n-1): a, b = a+b, a return a @@ -42,13 +42,14 @@ class FibonacciBenchmark(Benchmark): f(n) t2 = clock() return t2-t1 + # Need to repeat many times to get accurate timings for small n - else: - t1 = clock() - f(n); f(n); f(n); f(n); f(n); f(n); f(n) - f(n); f(n); f(n); f(n); f(n); f(n); f(n) - t2 = clock() - return (t2 - t1) / 14 + t1 = clock() + # pylint: disable=multiple-statements + f(n); f(n); f(n); f(n); f(n); f(n); f(n) + f(n); f(n); f(n); f(n); f(n); f(n); f(n) + t2 = clock() + return (t2 - t1) / 14 if __name__ == '__main__': FibonacciBenchmark().print_result() diff --git a/LibOS/shim/test/ltp/contrib/conf_merge.py b/LibOS/shim/test/ltp/contrib/conf_merge.py index 8933fb69..74d688e9 100755 --- a/LibOS/shim/test/ltp/contrib/conf_merge.py +++ b/LibOS/shim/test/ltp/contrib/conf_merge.py @@ -4,7 +4,6 @@ import argparse import collections -import sys DEFAULT = 'DEFAULT' diff --git a/LibOS/shim/test/ltp/contrib/conf_missing.py b/LibOS/shim/test/ltp/contrib/conf_missing.py index 3e41f9a4..dbad268d 100755 --- a/LibOS/shim/test/ltp/contrib/conf_missing.py +++ b/LibOS/shim/test/ltp/contrib/conf_missing.py @@ -4,7 +4,6 @@ import argparse import configparser -import sys argparser = argparse.ArgumentParser() argparser.add_argument('--config', '-c', metavar='FILENAME', @@ -22,7 +21,8 @@ def main(args=None): with args.file: for line in args.file: line = line.strip() - if not line or line[0] == '#': continue + if not line or line[0] == '#': + continue tag, cmd = line.split(maxsplit=1) if not tag in config and not any(c in cmd for c in '|;&'): diff --git a/LibOS/shim/test/ltp/runltp_xml.py b/LibOS/shim/test/ltp/runltp_xml.py index 802325ef..5d37b943 100755 --- a/LibOS/shim/test/ltp/runltp_xml.py +++ b/LibOS/shim/test/ltp/runltp_xml.py @@ -226,8 +226,7 @@ class TestRunner: # We don't run those in unit tests. if 'must-pass' in self.cfgsection: raise Error('invalid shell command with must-pass') - else: - raise Skip('invalid shell command') + raise Skip('invalid shell command') def get_executable_name(self): '''Return the executable name, or :py:obj:`None` if the test will not @@ -330,8 +329,6 @@ class TestRunner: This is normally done only for a test that has non-empty ``must-pass`` config directive. ''' - # pylint: disable=too-many-branches - notfound = must_pass.copy() passed = set() failed = set() @@ -413,9 +410,8 @@ class TestRunner: raise Error('binary did not provide any subtests, see stdout ' '(returncode={returncode}, must-pass=[{must_pass}])'.format( **self.props)) - else: - raise Skip('binary without subtests, see stdout ' - '(returncode={returncode})'.format(**self.props)) + raise Skip('binary without subtests, see stdout ' + '(returncode={returncode})'.format(**self.props)) if maybe_unneeded_must_pass and not notfound: # all subtests passed and must-pass specified exactly all subtests diff --git a/LibOS/shim/test/regression/test_libos.py b/LibOS/shim/test/regression/test_libos.py index 3e720879..1dcb54e8 100644 --- a/LibOS/shim/test/regression/test_libos.py +++ b/LibOS/shim/test/regression/test_libos.py @@ -5,7 +5,6 @@ import re import shutil import signal import subprocess -import sys import unittest from regression import ( @@ -66,7 +65,7 @@ class TC_01_Bootstrap(RegressionTestCase): manifest = self.get_manifest('env_from_host') stdout, _ = self.run_binary([manifest], env=host_envs) self.assertIn('# of envs: %d\n' % (len(host_envs) + len(manifest_envs)), stdout) - for i, (key, val) in enumerate({**host_envs, **manifest_envs}.items()): + for _, (key, val) in enumerate({**host_envs, **manifest_envs}.items()): # We don't enforce any specific order of envs, so we skip checking the index. self.assertIn('] = %s\n' % (key + '=' + val), stdout) @@ -82,7 +81,7 @@ class TC_01_Bootstrap(RegressionTestCase): manifest = self.get_manifest('env_from_file') stdout, _ = self.run_binary([manifest], env=host_envs) self.assertIn('# of envs: %d\n' % (len(envs) + len(manifest_envs)), stdout) - for i, arg in enumerate(envs + manifest_envs): + for _, arg in enumerate(envs + manifest_envs): # We don't enforce any specific order of envs, so we skip checking the index. self.assertIn('] = %s\n' % arg, stdout) finally: @@ -115,22 +114,8 @@ class TC_01_Bootstrap(RegressionTestCase): # 2 page child binary self.assertIn( - '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ' - '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ', + '0' * 89 + ' ' + + ('0' * 93 + ' ') * 15, stdout) def test_201_exec_same(self): @@ -189,7 +174,7 @@ class TC_01_Bootstrap(RegressionTestCase): try: self.run_binary(['exit_group']) except subprocess.CalledProcessError as e: - self.assertTrue(1 <= e.returncode and e.returncode <= 4) + self.assertTrue(1 <= e.returncode <= 4) def test_402_signalexit(self): with self.expect_returncode(134): @@ -275,14 +260,16 @@ class TC_03_FileCheckPolicy(RegressionTestCase): manifest = self.get_manifest('file_check_policy_allow_all_but_log') stdout, stderr = self.run_binary([manifest, 'unknown_testfile']) - self.assertIn('Allowing access to an unknown file due to file_check_policy settings: file:unknown_testfile', stderr) + self.assertIn('Allowing access to an unknown file due to file_check_policy settings: ' + 'file:unknown_testfile', stderr) self.assertIn('file_check_policy succeeded', stdout) def test_003_allow_all_but_log_fail(self): manifest = self.get_manifest('file_check_policy_allow_all_but_log') stdout, stderr = self.run_binary([manifest, 'trusted_testfile']) - self.assertNotIn('Allowing access to an unknown file due to file_check_policy settings: file:trusted_testfile', stderr) + self.assertNotIn('Allowing access to an unknown file due to file_check_policy settings: ' + 'file:trusted_testfile', stderr) self.assertIn('file_check_policy succeeded', stdout) @unittest.skipUnless(HAS_SGX, @@ -515,8 +502,8 @@ class TC_30_Syscall(RegressionTestCase): def test_100_get_set_groups(self): stdout, _ = self.run_binary(['groups']) - self.assertIn('child OK', stdout); - self.assertIn('parent OK', stdout); + self.assertIn('child OK', stdout) + self.assertIn('parent OK', stdout) def test_101_sched_set_get_cpuaffinity(self): stdout, _ = self.run_binary(['sched_set_get_affinity']) @@ -619,7 +606,7 @@ class TC_50_GDB(RegressionTestCase): # While the stack trace in SGX is unbroken, it currently starts at _start inside # enclave, instead of including eclave entry. - stdout, stderr = self.run_gdb(['debug'], 'debug.gdb') + stdout, _ = self.run_gdb(['debug'], 'debug.gdb') backtrace_1 = self.find('backtrace 1', stdout) self.assertIn(' main () at debug.c', backtrace_1) @@ -647,7 +634,7 @@ class TC_50_GDB(RegressionTestCase): # To run this test manually, use: # GDB=1 GDB_SCRIPT=debug_regs-x86_64.gdb ./pal_loader debug_regs-x86_64 - stdout, stderr = self.run_gdb(['debug_regs-x86_64'], 'debug_regs-x86_64.gdb') + stdout, _ = self.run_gdb(['debug_regs-x86_64'], 'debug_regs-x86_64.gdb') rdx = self.find('RDX', stdout) self.assertEqual(rdx, '$1 = 0x1000100010001000') diff --git a/Pal/regression/test_pal.py b/Pal/regression/test_pal.py index e79c9961..80cd91a2 100644 --- a/Pal/regression/test_pal.py +++ b/Pal/regression/test_pal.py @@ -3,13 +3,11 @@ import ast import collections import mmap -import os import pathlib import random import shutil import string import subprocess -import sys import unittest from regression import ( @@ -19,10 +17,6 @@ from regression import ( expectedFailureIf, ) -if HAS_SGX: - sys.path.insert(0, os.path.dirname(__file__) + '/../src/host/Linux-SGX/signer') - from pal_sgx_sign import read_manifest - CPUINFO_FLAGS_WHITELIST = [ 'fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce', 'cx8', 'apic', 'sep', 'mtrr', 'pge', 'mca', 'cmov', 'pat', 'pse36', 'pn', 'clflush', 'dts', @@ -230,7 +224,7 @@ class TC_01_Bootstrap(RegressionTestCase): _, stderr = self.run_binary(['fakenews']) self.fail( 'expected non-zero returncode, stderr: {!r}'.format(stderr)) - except subprocess.CalledProcessError as e: + except subprocess.CalledProcessError: pass class TC_02_Symbols(RegressionTestCase): @@ -292,7 +286,7 @@ class TC_02_Symbols(RegressionTestCase): class TC_10_Exception(RegressionTestCase): def is_altstack_different_from_main_stack(self, output): mainstack = 0 - altstack = 0 + altstack = 0 for line in output.splitlines(): if line.startswith('Stack in main:'): mainstack = int(line.split(':')[1], 0) diff --git a/Pal/src/host/Linux-SGX/gdb_integration/graphene_sgx_gdb.py b/Pal/src/host/Linux-SGX/gdb_integration/graphene_sgx_gdb.py index 7894f577..1377144f 100644 --- a/Pal/src/host/Linux-SGX/gdb_integration/graphene_sgx_gdb.py +++ b/Pal/src/host/Linux-SGX/gdb_integration/graphene_sgx_gdb.py @@ -7,7 +7,6 @@ import os import gdb # pylint: disable=import-error -# pylint: disable=no-self-use,too-few-public-methods _g_paginations = [] @@ -107,7 +106,7 @@ class PushPagination(gdb.Command): """ def __init__(self): - super(PushPagination, self).__init__("push-pagination", gdb.COMMAND_USER) + super().__init__("push-pagination", gdb.COMMAND_USER) def invoke(self, arg, _from_tty): self.dont_repeat() @@ -125,7 +124,7 @@ class PopPagination(gdb.Command): """Recover pagination state saved by PushPagination""" def __init__(self): - super(PopPagination, self).__init__("pop-pagination", gdb.COMMAND_USER) + super().__init__("pop-pagination", gdb.COMMAND_USER) def invoke(self, arg, _from_tty): self.dont_repeat() diff --git a/Scripts/regression.py b/Scripts/regression.py index f61b4bed..2941cd40 100644 --- a/Scripts/regression.py +++ b/Scripts/regression.py @@ -6,6 +6,8 @@ import subprocess import sys import unittest +# pylint: disable=subprocess-popen-preexec-fn,subprocess-run-check + HAS_SGX = os.environ.get('SGX') == '1' ON_X86 = os.uname().machine in ['x86_64'] diff --git a/Tools/gsc/gsc.py b/Tools/gsc/gsc.py index 544a4cad..565e7f47 100755 --- a/Tools/gsc/gsc.py +++ b/Tools/gsc/gsc.py @@ -11,8 +11,8 @@ import pathlib import shutil import sys import jinja2 -import docker -import yaml +import docker # pylint: disable=import-error +import yaml # pylint: disable=import-error def gsc_image_name(name): return f'gsc-{name}' @@ -89,7 +89,7 @@ def extract_binary_cmd_from_image_config(config): # GSC has to make it explicit to prepare scripts and Intel SGX signatures entrypoint.extend(cmd) - if len(entrypoint) == 0: + if not entrypoint: print('Could not find the entrypoint binary to the application image.') sys.exit(1) @@ -356,7 +356,8 @@ sub_build.add_argument('manifests', help='Application-specific manifest files. The first manifest will be used for the entry ' 'point of the Docker image.') -sub_build_graphene = subcommands.add_parser('build-graphene', help="Build base Graphene Docker image") +sub_build_graphene = subcommands.add_parser('build-graphene', + help="Build base Graphene Docker image") sub_build_graphene.set_defaults(command=gsc_build_graphene) sub_build_graphene.add_argument('-d', '--debug', action='store_true', help='Compile Graphene with debug flags and output.') @@ -368,7 +369,8 @@ sub_build_graphene.add_argument('--rm', action='store_true', help='Remove intermediate Docker images when build is successful.') sub_build_graphene.add_argument('--build-arg', action='append', default=[], help='Set build-time variables (same as "docker build --build-arg").') -sub_build_graphene.add_argument('-c', '--config_file', type=argparse.FileType('r', encoding='UTF-8'), +sub_build_graphene.add_argument('-c', '--config_file', + type=argparse.FileType('r', encoding='UTF-8'), default='config.yaml', help='Specify configuration file.') sub_build_graphene.add_argument('-f', '--file-only', action='store_true', help='Stop after Dockerfile is created and do not build the Docker image.') diff --git a/tests/benchmarks/makeenv.py b/tests/benchmarks/makeenv.py index 75d10b65..5bf873b5 100644 --- a/tests/benchmarks/makeenv.py +++ b/tests/benchmarks/makeenv.py @@ -39,6 +39,7 @@ class MakeEnvironment(asv.environment.Environment): def _run(self, *args, env=None, **kwds): # when we don't need asv.util.check_*, do not use, because it may deadlock # (those functions have problems with their poor reimplementation of .communicate()) + # pylint: disable=subprocess-run-check return subprocess.run(*args, env=self._get_env_for_subprocess(env), **kwds) def run(self, args, *, env=None, **kwargs):