From a03324c4afc555c77a64508e2d3c94dd9e5c746b Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Fri, 30 Aug 2024 18:16:28 +0100 Subject: [PATCH 1/2] Temporarily ignore 2 mypy type-var errors caused by the more precise type annotation of ``numpy.number`` comparison operators introduced in NumPy 2.1, see: https://github.com/python/typeshed/issues/12562 Fix the following errors when running test_galaxy_packages on Python >=3.10: ``` galaxy/tool_util/verify/__init__.py:503: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "floating[Any]" [type-var] iou_list.append(max(cc1_iou_list)) ^~~~~~~~~~~~~~~~~ galaxy/tool_util/verify/__init__.py:532: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "floating[Any]" [type-var] return min(_multiobject_intersection_over_union(mask1, mask2, pin_labels)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- lib/galaxy/tool_util/verify/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tool_util/verify/__init__.py b/lib/galaxy/tool_util/verify/__init__.py index e54a70c9d7af..54b5eb80062b 100644 --- a/lib/galaxy/tool_util/verify/__init__.py +++ b/lib/galaxy/tool_util/verify/__init__.py @@ -455,14 +455,14 @@ def files_contains(file1, file2, attributes=None): def _multiobject_intersection_over_union( mask1: "numpy.typing.NDArray", mask2: "numpy.typing.NDArray", repeat_reverse: bool = True ) -> List["numpy.floating"]: - iou_list = [] + iou_list: List[numpy.floating] = [] for label1 in numpy.unique(mask1): cc1 = mask1 == label1 - cc1_iou_list = [] + cc1_iou_list: List[numpy.floating] = [] for label2 in numpy.unique(mask2[cc1]): cc2 = mask2 == label2 cc1_iou_list.append(intersection_over_union(cc1, cc2)) - iou_list.append(max(cc1_iou_list)) + iou_list.append(max(cc1_iou_list)) # type: ignore[type-var, unused-ignore] # https://github.com/python/typeshed/issues/12562 if repeat_reverse: iou_list.extend(_multiobject_intersection_over_union(mask2, mask1, repeat_reverse=False)) return iou_list @@ -475,7 +475,7 @@ def intersection_over_union(mask1: "numpy.typing.NDArray", mask2: "numpy.typing. if mask1.dtype == bool: return numpy.logical_and(mask1, mask2).sum() / numpy.logical_or(mask1, mask2).sum() else: - return min(_multiobject_intersection_over_union(mask1, mask2)) + return min(_multiobject_intersection_over_union(mask1, mask2)) # type: ignore[type-var, unused-ignore] # https://github.com/python/typeshed/issues/12562 def get_image_metric( From ac40e41d96a38e9af63421aa916055004b9ede10 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 9 Oct 2024 22:04:14 +0200 Subject: [PATCH 2/2] Pin ubuntu 22.04 for minikube setup action The `ubuntu-latest` runner label is moving to 24.04, see https://github.blog/changelog/2024-09-25-actions-new-images-and-ubuntu-latest-changes/ Fixes https://github.com/galaxyproject/galaxy/actions/runs/11260477825/job/31317049837?pr=18963: ``` No VM guests are running outdated hypervisor (qemu) binaries on this host. /usr/bin/lsb_release --short --codename noble Error: Unexpected HTTP response: 404 ``` --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 0dc78ef4bb1c..92a0370c6f27 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -25,7 +25,7 @@ concurrency: jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: