From 2ba942ba768670fe89b0f2d9a2f3e3037d9160ac Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 1 Nov 2021 09:57:16 +0100 Subject: [PATCH] pre-commit: manual adjustments following black --- .github/integration-test.py | 13 +++++-------- bootstrap/bootstrap.py | 4 ++-- docs/conf.py | 13 +++++++++++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/integration-test.py b/.github/integration-test.py index 7e59669..210e008 100755 --- a/.github/integration-test.py +++ b/.github/integration-test.py @@ -10,7 +10,7 @@ def build_systemd_image(image_name, source_path, build_args=None): Built image is tagged with image_name """ - cmd = ['docker', 'build', '-t', image_name, source_path] + cmd = ['docker', 'build', f'-t={image_name}', source_path] if build_args: cmd.extend([f"--build-arg={ba}" for ba in build_args]) subprocess.check_call(cmd) @@ -28,15 +28,12 @@ def run_systemd_image(image_name, container_name, bootstrap_pip_spec): 'docker', 'run', '--privileged', - '--mount', - 'type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup', + '--mount=type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup', '--detach', - '--name', - container_name, + f'--name={container_name}', # A bit less than 1GB to ensure TLJH runs on 1GB VMs. # If this is changed all docs references to the required memory must be changed too. - '--memory', - '900m', + '--memory=900m', ] if bootstrap_pip_spec: @@ -67,7 +64,7 @@ def run_container_command(container_name, cmd): Run cmd in a running container with a bash shell """ proc = subprocess.run( - ['docker', 'exec', '-t', container_name, '/bin/bash', '-c', cmd], check=True + ["docker", "exec", "-t", container_name, "/bin/bash", "-c", cmd], check=True ) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 14d0f67..11e6592 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -187,8 +187,8 @@ def ensure_host_system_can_install_tljh(): return ( subprocess.check_output( [ - '/bin/bash', - '-c', + "/bin/bash", + "-c", "source /etc/os-release && echo ${{{key}}}".format(key=key), ] ) diff --git a/docs/conf.py b/docs/conf.py index b3c283f..d2bd398 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,11 @@ version = '' release = 'v0.1' # Enable MathJax for Math -extensions = ['sphinx.ext.mathjax', 'sphinx.ext.intersphinx', 'sphinx_copybutton'] +extensions = [ + 'sphinx.ext.mathjax', + 'sphinx.ext.intersphinx', + 'sphinx_copybutton', +] # The root toctree document. root_doc = master_doc = "index" @@ -20,7 +24,12 @@ root_doc = master_doc = "index" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'install/custom.rst'] +exclude_patterns = [ + '_build', + 'Thumbs.db', + '.DS_Store', + 'install/custom.rst', +] intersphinx_mapping = { 'sphinx': ('http://www.sphinx-doc.org/en/master/', None),