From a887f1a48a564225b422f39488d404e2114b039f Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Mon, 27 Jan 2025 17:06:28 +0530 Subject: [PATCH] Add Python 3.13 for PR checks in GHA Signed-off-by: Gaurav Talreja --- .github/workflows/pull_request.yml | 2 +- .github/workflows/release_to_pypi.yml | 4 ++-- .pre-commit-config.yaml | 4 ++-- tests/test_hawkular.py | 6 +++--- wrapanapi/systems/container/rhopenshift.py | 4 ++-- wrapanapi/systems/msazure.py | 6 ++---- wrapanapi/systems/openstack.py | 2 +- wrapanapi/systems/rhevm.py | 5 +++-- 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b33afc7c..ab3b8025 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [3.9, 3.12] + python: [3.11, 3.12, 3.13] steps: - name: Checkout WrapanAPI uses: actions/checkout@v3 diff --git a/.github/workflows/release_to_pypi.yml b/.github/workflows/release_to_pypi.yml index ced52c77..608e78fd 100644 --- a/.github/workflows/release_to_pypi.yml +++ b/.github/workflows/release_to_pypi.yml @@ -20,7 +20,7 @@ jobs: - name: Set Up Python3 uses: actions/setup-python@v3 with: - python-version: 3.9 + python-version: 3.13 - name: Install Dependencies run: | @@ -52,7 +52,7 @@ jobs: - name: Set Up Python3 uses: actions/setup-python@v3 with: - python-version: 3.9 + python-version: 3.13 - name: Setup and Build run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 861f1dc9..4572b055 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.3 + rev: v0.9.3 hooks: # Run the linter. - id: ruff @@ -24,7 +24,7 @@ repos: - id: end-of-file-fixer - id: debug-statements - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py3-plus, --py311-plus] diff --git a/tests/test_hawkular.py b/tests/test_hawkular.py index 5b9e0570..45dda49d 100644 --- a/tests/test_hawkular.py +++ b/tests/test_hawkular.py @@ -291,9 +291,9 @@ def test_list_server_datasource(provider): assert datasource.id assert datasource.name assert datasource.path - assert ( - found | provider.inventory._stats_available["num_datasource"](provider.inventory) > 0 - ), "No any datasource is listed for any of feeds, but they exists" + assert found | provider.inventory._stats_available["num_datasource"](provider.inventory) > 0, ( + "No any datasource is listed for any of feeds, but they exists" + ) def test_path(provider): diff --git a/wrapanapi/systems/container/rhopenshift.py b/wrapanapi/systems/container/rhopenshift.py index 87965198..fbfcfce0 100644 --- a/wrapanapi/systems/container/rhopenshift.py +++ b/wrapanapi/systems/container/rhopenshift.py @@ -1273,7 +1273,7 @@ def check_scale_value(): else: raise ValueError( - "This name %s is not found among " "deployment configs or stateful sets", name + "This name %s is not found among deployment configs or stateful sets", name ) self.logger.info("scaling entity %s to %s replicas", name, replicas) wait_for(check_scale_value, timeout=wait, fail_condition=lambda val: val != replicas) @@ -1432,7 +1432,7 @@ def is_vm_stopped(self, vm_name): pods = self.k_api.list_namespaced_pod(namespace=vm_name).items if pods: self.logger.info( - ("some pods are still " "running: {}").format([pod.metadata.name for pod in pods]) + ("some pods are still running: {}").format([pod.metadata.name for pod in pods]) ) return not bool(pods) diff --git a/wrapanapi/systems/msazure.py b/wrapanapi/systems/msazure.py index 949ed44a..72815641 100644 --- a/wrapanapi/systems/msazure.py +++ b/wrapanapi/systems/msazure.py @@ -784,7 +784,7 @@ def list_security_group(self): def list_security_group_ports(self, sec_group_name, resource_group=None): resource_group = resource_group or self.resource_group self.logger.info( - 'Attempting to List ports from Azure security group "%s"' 'in resource group "%s"', + 'Attempting to List ports from Azure security group "%s"in resource group "%s"', sec_group_name, resource_group, ) @@ -974,9 +974,7 @@ def create_netsec_group_port_allow( **kwargs, ): resource_group = resource_group or self.resource_group - self.logger.info( - "Attempting to Create New Azure Security Group " "Rule '%s'.", secgroup_name - ) + self.logger.info("Attempting to Create New Azure Security Group Rule '%s'.", secgroup_name) parameters = NetworkSecurityGroup(location=self.region) parameters.security_rules = [ diff --git a/wrapanapi/systems/openstack.py b/wrapanapi/systems/openstack.py index 4f5909db..4bdc6d6d 100644 --- a/wrapanapi/systems/openstack.py +++ b/wrapanapi/systems/openstack.py @@ -772,7 +772,7 @@ def add_tenant( if user and roles: if self.keystone_version == 3: raise NotImplementedError( - "Role assignments for users are not implemented yet for " "Keystone V3" + "Role assignments for users are not implemented yet for Keystone V3" ) user = self._get_user(name=user) for role in roles: diff --git a/wrapanapi/systems/rhevm.py b/wrapanapi/systems/rhevm.py index 9382afe0..51ddcb15 100644 --- a/wrapanapi/systems/rhevm.py +++ b/wrapanapi/systems/rhevm.py @@ -1240,8 +1240,9 @@ def change_storage_domain_state(self, state, storage_domain_name, timeout=300): active = types.StorageDomainStatus.ACTIVE if desired_state is None: raise ValueError( - "Invalid state [{}] passed for setting storage domain, " - "value values are {}".format(state, list(types.StorageDomainStatus)) + "Invalid state [{}] passed for setting storage domain, value values are {}".format( + state, list(types.StorageDomainStatus) + ) ) for datacenter in self._data_centers_service.list(): for domain in self.api.follow_link(datacenter.storage_domains):