From 45feb5e158bacadee9f2d51aca43bddb00dbdf1c Mon Sep 17 00:00:00 2001 From: Urvashi Mohnani Date: Thu, 9 Nov 2023 06:18:58 -0500 Subject: [PATCH 1/2] Fix readthedocs yaml Builds on readthedocs was failing due to a new requirement in the yaml. Fix that to get the builds working again. Signed-off-by: Urvashi Mohnani --- .readthedocs.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 12156b89..28b37ffd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,15 +1,26 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required version: 2 formats: - pdf - epub +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html python: - version: "3.6" install: - - requirements: requirements.txt + - requirements: requirements.txt +# Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/source/conf.py fail_on_warning: false - From 9037bd87a9f2fc7a2d6bd33dffd8315bac88eb0f Mon Sep 17 00:00:00 2001 From: Urvashi Mohnani Date: Thu, 9 Nov 2023 06:30:40 -0500 Subject: [PATCH 2/2] Fix some more lint issues Signed-off-by: Urvashi Mohnani --- podman/domain/containers_create.py | 12 ++++----- podman/domain/images_manager.py | 10 +++---- podman/domain/ipam.py | 26 ++++++++----------- .../integration/test_container_create.py | 22 +++++++--------- podman/tests/integration/utils.py | 14 +++++----- podman/tlsconfig.py | 1 + 6 files changed, 36 insertions(+), 49 deletions(-) diff --git a/podman/domain/containers_create.py b/podman/domain/containers_create.py index 818ff415..6f64d59f 100644 --- a/podman/domain/containers_create.py +++ b/podman/domain/containers_create.py @@ -657,13 +657,11 @@ def parse_host_port(_container_port, _protocol, _host): } for item in args.pop("ulimits", []): - params["r_limits"].append( - { - "type": item["Name"], - "hard": item["Hard"], - "soft": item["Soft"], - } - ) + params["r_limits"].append({ + "type": item["Name"], + "hard": item["Hard"], + "soft": item["Soft"], + }) for item in args.pop("volumes", {}).items(): key, value = item diff --git a/podman/domain/images_manager.py b/podman/domain/images_manager.py index abab3d67..503dcbf4 100644 --- a/podman/domain/images_manager.py +++ b/podman/domain/images_manager.py @@ -153,12 +153,10 @@ def prune( error.append(element["Err"]) else: reclaimed += element["Size"] - deleted.append( - { - "Deleted": element["Id"], - "Untagged": "", - } - ) + deleted.append({ + "Deleted": element["Id"], + "Untagged": "", + }) if len(error) > 0: raise APIError(response.url, response=response, explanation="; ".join(error)) diff --git a/podman/domain/ipam.py b/podman/domain/ipam.py index 98a78350..79a4b2c5 100644 --- a/podman/domain/ipam.py +++ b/podman/domain/ipam.py @@ -25,14 +25,12 @@ def __init__( aux_addresses: Ignored. """ super().__init__() - self.update( - { - "AuxiliaryAddresses": aux_addresses, - "Gateway": gateway, - "IPRange": iprange, - "Subnet": subnet, - } - ) + self.update({ + "AuxiliaryAddresses": aux_addresses, + "Gateway": gateway, + "IPRange": iprange, + "Subnet": subnet, + }) class IPAMConfig(dict): @@ -52,10 +50,8 @@ def __init__( options: Options to provide to the Network driver. """ super().__init__() - self.update( - { - "Config": pool_configs or [], - "Driver": driver, - "Options": options or {}, - } - ) + self.update({ + "Config": pool_configs or [], + "Driver": driver, + "Options": options or {}, + }) diff --git a/podman/tests/integration/test_container_create.py b/podman/tests/integration/test_container_create.py index fdd98c77..f05a29ed 100644 --- a/podman/tests/integration/test_container_create.py +++ b/podman/tests/integration/test_container_create.py @@ -149,12 +149,10 @@ def test_container_ports(self): self.containers.append(container) self.assertTrue( - all( - [ - x in port_test['expected_output'] - for x in container.attrs.get('HostConfig', {}).get('PortBindings') - ] - ) + all([ + x in port_test['expected_output'] + for x in container.attrs.get('HostConfig', {}).get('PortBindings') + ]) ) def test_container_healthchecks(self): @@ -243,13 +241,11 @@ def test_container_devices(self): for device in devices: path_on_host, path_in_container = device.split(':', 1) self.assertTrue( - any( - [ - c.get('PathOnHost') == path_on_host - and c.get('PathInContainer') == path_in_container - for c in container_devices - ] - ) + any([ + c.get('PathOnHost') == path_on_host + and c.get('PathInContainer') == path_in_container + for c in container_devices + ]) ) with self.subTest("Check devices in running container object"): diff --git a/podman/tests/integration/utils.py b/podman/tests/integration/utils.py index 78aea63a..0f1720cd 100644 --- a/podman/tests/integration/utils.py +++ b/podman/tests/integration/utils.py @@ -66,14 +66,12 @@ def __init__( if os.environ.get("container") == "oci": self.cmd.append("--storage-driver=vfs") - self.cmd.extend( - [ - "system", - "service", - f"--time={timeout}", - socket_uri, - ] - ) + self.cmd.extend([ + "system", + "service", + f"--time={timeout}", + socket_uri, + ]) process = subprocess.run( [podman_exe, "--version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT diff --git a/podman/tlsconfig.py b/podman/tlsconfig.py index 0a853bbe..fe0578bc 100644 --- a/podman/tlsconfig.py +++ b/podman/tlsconfig.py @@ -1,5 +1,6 @@ """Holds TLS configuration.""" + class TLSConfig: """TLS configuration.