From 5ddff4d8a8820b6d7c904969d690a53e17335c12 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 2 Mar 2025 18:45:18 +0100 Subject: [PATCH 1/5] Update codespell. --- requirements-lint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-lint.txt b/requirements-lint.txt index a273f6be4b..9b28f2a246 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -7,7 +7,7 @@ black==25.1.0; python_version >= '3.7' and implementation_name == "cpython" isort[pyproject]==6.0.1; python_version >= '3.8' pyupgrade==3.3.1 rstcheck==6.2.4; python_version >= '3.7' -codespell==2.2.5 +codespell==2.4.1 requests>=2.27.1 paramiko==3.4.0; platform_python_implementation != 'PyPy' From 8756555efee9e88694bd04424f68a53e24d8c50a Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 2 Mar 2025 18:47:12 +0100 Subject: [PATCH 2/5] Fix various typos detected by latest version of codespell. --- libcloud/common/openstack.py | 2 +- libcloud/common/openstack_identity.py | 2 +- libcloud/compute/base.py | 2 +- libcloud/compute/deployment.py | 2 +- libcloud/compute/drivers/ec2.py | 2 +- libcloud/compute/drivers/gce.py | 2 +- libcloud/compute/drivers/kubevirt.py | 2 +- libcloud/compute/drivers/outscale.py | 2 +- libcloud/compute/drivers/vcloud.py | 2 +- libcloud/compute/drivers/vsphere.py | 4 ++-- libcloud/compute/ssh.py | 2 +- libcloud/container/drivers/lxd.py | 2 +- libcloud/http.py | 2 +- libcloud/storage/drivers/cloudfiles.py | 2 +- libcloud/test/common/test_openstack_identity.py | 2 +- libcloud/test/compute/test_openstack.py | 2 +- libcloud/test/compute/test_ssh_client.py | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libcloud/common/openstack.py b/libcloud/common/openstack.py index 6c363316b6..2e899dc4fa 100644 --- a/libcloud/common/openstack.py +++ b/libcloud/common/openstack.py @@ -362,7 +362,7 @@ def _set_up_connection_info(self, url): new_conn = (self.host, self.port, self.secure) if new_conn != prev_conn: # We only call connect in case connection details have changed - this way we correctly - # re-use connection in case nothing has changed + # reuse connection in case nothing has changed self.connect() def _populate_hosts_and_request_paths(self): diff --git a/libcloud/common/openstack_identity.py b/libcloud/common/openstack_identity.py index db47d5d98d..554262672f 100644 --- a/libcloud/common/openstack_identity.py +++ b/libcloud/common/openstack_identity.py @@ -90,7 +90,7 @@ class OpenStackAuthenticationCache: :class:`OpenStackAuthenticationCache` in OpenStackIdentityConnection.auth_cache. - Cache implementors should inherit this class and define the methods below. + Cache implementers should inherit this class and define the methods below. """ def get(self, key): diff --git a/libcloud/compute/base.py b/libcloud/compute/base.py index 58f3c0f4c1..0f855bfa6a 100644 --- a/libcloud/compute/base.py +++ b/libcloud/compute/base.py @@ -1947,7 +1947,7 @@ def _run_deployment_script(self, task, node, ssh_client, max_tries=3): if "ssh session not active" in str(e).lower(): # Sometimes connection gets closed or disconnected half - # way through for wahtever reason. + # way through for whatever reason. # If this happens, we try to re-connect before # re-attempting to run the step. try: diff --git a/libcloud/compute/deployment.py b/libcloud/compute/deployment.py index 40514114ae..78f07b2926 100644 --- a/libcloud/compute/deployment.py +++ b/libcloud/compute/deployment.py @@ -197,7 +197,7 @@ def run(self, node, client): """ self.name = cast(str, self.name) file_path = client.put(path=self.name, chmod=int("755", 8), contents=self.script) - # Pre-pend cwd if user specified a relative path + # Prepend cwd if user specified a relative path if self.name and (self.name[0] not in ["/", "\\"] and not re.match(r"^\w\:.*$", file_path)): base_path = os.path.dirname(file_path) name = os.path.join(base_path, self.name) diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py index b6d609cb5e..1ab9291749 100644 --- a/libcloud/compute/drivers/ec2.py +++ b/libcloud/compute/drivers/ec2.py @@ -1651,7 +1651,7 @@ def create_node( if ex_security_group_ids and not ex_subnet: raise ValueError( - "You can only supply ex_security_group_ids" " combinated with ex_subnet" + "You can only supply ex_security_group_ids" " combined with ex_subnet" ) security_group_ids = ex_security_group_ids diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index 58a3468d78..ca6f269a9a 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -229,7 +229,7 @@ def _merge_response_items(self, list_name, response_list): """ Take a list of API responses ("item"-portion only) and combine them. - Helper function to combine multiple aggegrated responses into a single + Helper function to combine multiple aggregated responses into a single dictionary that resembles an API response. Note: keys that don't have a 'list_name" key (including warnings) diff --git a/libcloud/compute/drivers/kubevirt.py b/libcloud/compute/drivers/kubevirt.py index 3de011e5fc..b1b5678cb4 100644 --- a/libcloud/compute/drivers/kubevirt.py +++ b/libcloud/compute/drivers/kubevirt.py @@ -956,7 +956,7 @@ def create_node( be used for the creation of the Persistent Volume Claim. Make sure it allows for - dymamic provisioning. + dynamic provisioning. - optional: - access_mode: default is ReadWriteOnce - volume_mode: default is `Filesystem`, it can also be `Block` diff --git a/libcloud/compute/drivers/outscale.py b/libcloud/compute/drivers/outscale.py index b0ae07cb99..1fd5a57457 100644 --- a/libcloud/compute/drivers/outscale.py +++ b/libcloud/compute/drivers/outscale.py @@ -5427,7 +5427,7 @@ def ex_link_private_ips( :type private_ips: ``list`` of ``str`` :param secondary_private_ip_count: The secondary private IP a - ddress or addresses you want to assign to the NIC within the IP + address or addresses you want to assign to the NIC within the IP address range of the Subnet. :type secondary_private_ip_count: ``int`` diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py index 913cca45c0..59192534f5 100644 --- a/libcloud/compute/drivers/vcloud.py +++ b/libcloud/compute/drivers/vcloud.py @@ -707,7 +707,7 @@ def destroy_node(self, node): self._wait_for_task_completion(res.object.get("href")) except ExpatError: # The undeploy response is malformed XML atm. - # We can remove this whent he providers fix the problem. + # We can remove this when the providers fix the problem. pass except Exception: # Some vendors don't implement undeploy at all yet, diff --git a/libcloud/compute/drivers/vsphere.py b/libcloud/compute/drivers/vsphere.py index d6958ac404..c7372c2aed 100644 --- a/libcloud/compute/drivers/vsphere.py +++ b/libcloud/compute/drivers/vsphere.py @@ -2043,7 +2043,7 @@ def create_node( ex_folder = folder["folder"] if ex_folder is None: - msg = "No suitable folder vor VMs found, please create one" + msg = "No suitable folder for VMs found, please create one" raise ProviderError(msg, 404) spec["placement"]["folder"] = ex_folder @@ -2176,7 +2176,7 @@ def create_node( ex_folder = folder["folder"] if ex_folder is None: - msg = "No suitable folder vor VMs found, please create one" + msg = "No suitable folder for VMs found, please create one" raise ProviderError(msg, 404) spec["placement"]["folder"] = ex_folder diff --git a/libcloud/compute/ssh.py b/libcloud/compute/ssh.py index f1efb65b95..cd64b6e9e0 100644 --- a/libcloud/compute/ssh.py +++ b/libcloud/compute/ssh.py @@ -764,7 +764,7 @@ def _get_sftp_client(self): """ Create SFTP client from the underlying SSH client. - This method tries to re-use the existing self.sftp_client (if it + This method tries to reuse the existing self.sftp_client (if it exists) and it also tries to verify the connection is opened and if it's not, it will try to re-establish it. """ diff --git a/libcloud/container/drivers/lxd.py b/libcloud/container/drivers/lxd.py index c05a6c2ac9..23337cca3b 100644 --- a/libcloud/container/drivers/lxd.py +++ b/libcloud/container/drivers/lxd.py @@ -1135,7 +1135,7 @@ def ex_has_image(self, alias): :param alias: the image alias :type alias: ``str`` - :rtype: ``tupple`` :: (``boolean``, ``str``) + :rtype: ``tuple`` :: (``boolean``, ``str``) """ # get all the images existing on the host diff --git a/libcloud/http.py b/libcloud/http.py index d74707a55e..e09cc68b59 100644 --- a/libcloud/http.py +++ b/libcloud/http.py @@ -296,7 +296,7 @@ def _normalize_headers(self, headers): class HttpLibResponseProxy: """ - Provides a proxy pattern around the :class:`requests.Reponse` + Provides a proxy pattern around the :class:`requests.Response` object to a :class:`httplib.HTTPResponse` object """ diff --git a/libcloud/storage/drivers/cloudfiles.py b/libcloud/storage/drivers/cloudfiles.py index c126c11b0d..61e1c562fb 100644 --- a/libcloud/storage/drivers/cloudfiles.py +++ b/libcloud/storage/drivers/cloudfiles.py @@ -279,7 +279,7 @@ def __init__( :param region: ID of the region which should be used. :type region: ``str`` """ - # This is here for backard compatibility + # This is here for backward compatibility if "ex_force_service_region" in kwargs: region = kwargs["ex_force_service_region"] diff --git a/libcloud/test/common/test_openstack_identity.py b/libcloud/test/common/test_openstack_identity.py index 8f6b55066c..2e17cf5737 100644 --- a/libcloud/test/common/test_openstack_identity.py +++ b/libcloud/test/common/test_openstack_identity.py @@ -333,7 +333,7 @@ def test_authentication_cache(self): # Token is cached self.assertEqual(len(auth_cache), 1) - # New client, token from cache is re-used + # New client, token from cache is reused osa = cls(auth_url=auth_url, parent_conn=connection, **kwargs) osa.request = Mock(wraps=osa.request) osa = osa.authenticate() diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py index 4fcf08c753..d7aeb099fd 100644 --- a/libcloud/test/compute/test_openstack.py +++ b/libcloud/test/compute/test_openstack.py @@ -155,7 +155,7 @@ def test_populate_hosts_and_requests_path(self, _): count = 5 - # Test authentication and token re-use + # Test authentication and token reuse con = cls("username", "key") osa = con.get_auth_class() diff --git a/libcloud/test/compute/test_ssh_client.py b/libcloud/test/compute/test_ssh_client.py index 9a70cce92e..2f7c0cde4c 100644 --- a/libcloud/test/compute/test_ssh_client.py +++ b/libcloud/test/compute/test_ssh_client.py @@ -792,7 +792,7 @@ def test_get_sftp_client(self): self.assertEqual(client._get_sftp_client(), mock_sft_client) self.assertEqual(mock_client.open_sftp.call_count, 1) - # 2. existing sftp connection which is already opened is re-used + # 2. existing sftp connection which is already opened is reused mock_client = Mock() mock_sft_client = Mock() client.client = mock_client From beecb62dd055f215eb5031ac7dc9a19662f949ea Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 2 Mar 2025 18:59:44 +0100 Subject: [PATCH 3/5] Fix formatting. --- libcloud/compute/drivers/ec2.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py index 1ab9291749..770a30d15a 100644 --- a/libcloud/compute/drivers/ec2.py +++ b/libcloud/compute/drivers/ec2.py @@ -1650,9 +1650,7 @@ def create_node( params["SecurityGroup.%d" % (sig + 1,)] = security_groups[sig] if ex_security_group_ids and not ex_subnet: - raise ValueError( - "You can only supply ex_security_group_ids" " combined with ex_subnet" - ) + raise ValueError("You can only supply ex_security_group_ids" " combined with ex_subnet") security_group_ids = ex_security_group_ids security_group_id_params = {} From 06e6ee167f7c133428fe127f9bf69a55e6fc6153 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 2 Mar 2025 19:05:37 +0100 Subject: [PATCH 4/5] Upgrade tox. --- requirements-ci.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-ci.txt b/requirements-ci.txt index 5c6c3e27fc..fc411d5739 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1 +1 @@ -tox==4.15.1 +tox==4.24.1 From 0a5acdc042eb33c53895b1c6c93e9ecc14975ea7 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 2 Mar 2025 19:08:39 +0100 Subject: [PATCH 5/5] Store dev artifacts directly without compressing them so they can directly be downloaded, installed and re-used. --- .github/workflows/publish_dev_artifact.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_dev_artifact.yml b/.github/workflows/publish_dev_artifact.yml index a155a8a428..9c2e12a263 100644 --- a/.github/workflows/publish_dev_artifact.yml +++ b/.github/workflows/publish_dev_artifact.yml @@ -51,11 +51,20 @@ jobs: ls -la dist | grep .tar.gz ls -la dist | grep .whl - - name: Store dev artifacts + - name: Store dev artifacts - .tar.gz uses: actions/upload-artifact@v4 with: - name: libcloud-dev-artifacts + name: libcloud-dev-tarball retention-days: 60 + compression-level: 0 path: | dist/*.tar.gz + + - name: Store dev artifacts - .whl + uses: actions/upload-artifact@v4 + with: + name: libcloud-dev-wheel + retention-days: 60 + compression-level: 0 + path: | dist/*.whl