pre-commit: manual adjustments following black

This commit is contained in:
Erik Sundell
2021-11-01 09:57:16 +01:00
parent 771ae59636
commit 2ba942ba76
3 changed files with 18 additions and 12 deletions

View File

@@ -10,7 +10,7 @@ def build_systemd_image(image_name, source_path, build_args=None):
Built image is tagged with image_name 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: if build_args:
cmd.extend([f"--build-arg={ba}" for ba in build_args]) cmd.extend([f"--build-arg={ba}" for ba in build_args])
subprocess.check_call(cmd) subprocess.check_call(cmd)
@@ -28,15 +28,12 @@ def run_systemd_image(image_name, container_name, bootstrap_pip_spec):
'docker', 'docker',
'run', 'run',
'--privileged', '--privileged',
'--mount', '--mount=type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup',
'type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup',
'--detach', '--detach',
'--name', f'--name={container_name}',
container_name,
# A bit less than 1GB to ensure TLJH runs on 1GB VMs. # 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. # If this is changed all docs references to the required memory must be changed too.
'--memory', '--memory=900m',
'900m',
] ]
if bootstrap_pip_spec: 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 Run cmd in a running container with a bash shell
""" """
proc = subprocess.run( 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
) )

View File

@@ -187,8 +187,8 @@ def ensure_host_system_can_install_tljh():
return ( return (
subprocess.check_output( subprocess.check_output(
[ [
'/bin/bash', "/bin/bash",
'-c', "-c",
"source /etc/os-release && echo ${{{key}}}".format(key=key), "source /etc/os-release && echo ${{{key}}}".format(key=key),
] ]
) )

View File

@@ -12,7 +12,11 @@ version = ''
release = 'v0.1' release = 'v0.1'
# Enable MathJax for Math # 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. # The root toctree document.
root_doc = master_doc = "index" 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 # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path . # 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 = { intersphinx_mapping = {
'sphinx': ('http://www.sphinx-doc.org/en/master/', None), 'sphinx': ('http://www.sphinx-doc.org/en/master/', None),