From c929df997b2298504da859a8083325eed36004bb Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Thu, 10 Sep 2026 17:41:25 -0400 Subject: [PATCH 01/18] Update mypy version in pre-commit workflow: --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b403c4..8cac50e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: flake8 args: [ --max-line-length, "120" ] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.4.1 + rev: v2.3.1 hooks: - id: mypy args: [ --config-file, pyproject.toml ] From f7df31ca8e3e439ab2b93a773cc71cef311e39fc Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Thu, 10 Sep 2026 18:29:18 -0400 Subject: [PATCH 02/18] Fixing some mypy complaints --- src/abcd_graph/callbacks/visualizer.py | 6 +++--- src/abcd_graph/exporter.py | 6 +++--- src/abcd_graph/graph/core/utils.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/abcd_graph/callbacks/visualizer.py b/src/abcd_graph/callbacks/visualizer.py index b503617..43a3f83 100644 --- a/src/abcd_graph/callbacks/visualizer.py +++ b/src/abcd_graph/callbacks/visualizer.py @@ -50,7 +50,7 @@ def after_build(self, graph: GraphImpl, context: BuildContext, exporter: GraphEx @require("matplotlib") def draw_community_cdf(self) -> None: - import matplotlib.pyplot as plt # type: ignore[import] + import matplotlib.pyplot as plt # type: ignore[import-not-found] assert self._graph is not None @@ -104,8 +104,8 @@ def draw_communities(self) -> None: if self._model_used is not None and self._model_used.__name__ != "configuration_model": raise NotImplementedError("Drawing communities is only supported for the configuration model") - import networkx as nx # type: ignore[import] - from matplotlib import pyplot as plt + import networkx as nx # type: ignore[import-not-found] + from matplotlib import pyplot as plt # type: ignore[import-not-found] assert self._exporter is not None diff --git a/src/abcd_graph/exporter.py b/src/abcd_graph/exporter.py index 52b4bbc..42b2aaf 100644 --- a/src/abcd_graph/exporter.py +++ b/src/abcd_graph/exporter.py @@ -28,9 +28,9 @@ from abcd_graph.utils import require if TYPE_CHECKING: # pragma: no cover - from igraph import Graph as IGraph # type: ignore[import] - from networkx import Graph as NetworkXGraph # type: ignore[import] - from scipy.sparse import csr_matrix # type: ignore[import] + from igraph import Graph as IGraph # type: ignore[import-not-found] + from networkx import Graph as NetworkXGraph # type: ignore[import-not-found] + from scipy.sparse import csr_matrix # type: ignore[import-not-found] class GraphExporter: diff --git a/src/abcd_graph/graph/core/utils.py b/src/abcd_graph/graph/core/utils.py index 5e9c8e4..48a21f2 100644 --- a/src/abcd_graph/graph/core/utils.py +++ b/src/abcd_graph/graph/core/utils.py @@ -42,7 +42,7 @@ def powerlaw_distribution(choices: NDArray[np.float64], intensity: float) -> NDA def get_community_color_map(communities: list["Community"]) -> list[str]: - import matplotlib.colors as colors # type: ignore[import] + import matplotlib.colors as colors # type: ignore[import-not-found] colors_list = list(colors.BASE_COLORS.values())[: len(communities)] From 027f8bea9226ab16425bda6f09d615c694e4069f Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Thu, 10 Sep 2026 18:34:51 -0400 Subject: [PATCH 03/18] More mypy fixes --- src/abcd_graph/callbacks/visualizer.py | 4 ++-- src/abcd_graph/exporter.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/abcd_graph/callbacks/visualizer.py b/src/abcd_graph/callbacks/visualizer.py index 43a3f83..03772b0 100644 --- a/src/abcd_graph/callbacks/visualizer.py +++ b/src/abcd_graph/callbacks/visualizer.py @@ -104,8 +104,8 @@ def draw_communities(self) -> None: if self._model_used is not None and self._model_used.__name__ != "configuration_model": raise NotImplementedError("Drawing communities is only supported for the configuration model") - import networkx as nx # type: ignore[import-not-found] - from matplotlib import pyplot as plt # type: ignore[import-not-found] + import networkx as nx + from matplotlib import pyplot as plt assert self._exporter is not None diff --git a/src/abcd_graph/exporter.py b/src/abcd_graph/exporter.py index 42b2aaf..db26819 100644 --- a/src/abcd_graph/exporter.py +++ b/src/abcd_graph/exporter.py @@ -29,8 +29,8 @@ if TYPE_CHECKING: # pragma: no cover from igraph import Graph as IGraph # type: ignore[import-not-found] - from networkx import Graph as NetworkXGraph # type: ignore[import-not-found] - from scipy.sparse import csr_matrix # type: ignore[import-not-found] + from networkx import Graph as NetworkXGraph + from scipy.sparse import csr_matrix class GraphExporter: @@ -49,7 +49,7 @@ def to_adjacency_matrix(self) -> NDArray[np.bool_]: return self._graph.to_adj_matrix() @require("scipy") - def to_sparse_adjacency_matrix(self) -> "csr_matrix": # type: ignore[no-any-unimported] + def to_sparse_adjacency_matrix(self) -> "csr_matrix": from scipy.sparse import csr_matrix if not self.is_proper_abcd: @@ -69,9 +69,10 @@ def to_igraph(self) -> "IGraph": # type: ignore[no-any-unimported] return graph @require("networkx") - def to_networkx(self) -> "NetworkXGraph": # type: ignore[no-any-unimported] + def to_networkx(self) -> "NetworkXGraph": import networkx as nx + graph: nx.Graph = nx.Graph() graph = nx.Graph() graph.add_nodes_from(range(self._graph._params.vcount)) From 3ee125741aa5e0cb24ac19f4df50070997d3af5f Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Thu, 10 Sep 2026 18:37:26 -0400 Subject: [PATCH 04/18] Change aqua security to new version --- .github/workflows/docker-in-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-in-ci.yml b/.github/workflows/docker-in-ci.yml index 6154020..3046c55 100644 --- a/.github/workflows/docker-in-ci.yml +++ b/.github/workflows/docker-in-ci.yml @@ -22,7 +22,7 @@ jobs: docker image inspect abcd-graph - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.31.0 + uses: aquasecurity/setup-trivy@v1 with: image-ref: 'abcd-graph' format: 'table' @@ -52,7 +52,7 @@ jobs: docker image inspect abcd-graph-full - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.31.0 + uses: aquasecurity/setup-trivy@v1 with: image-ref: 'abcd-graph-full' format: 'table' From 5bd7191d9162612ee4a28128d6e9b94755c6ed53 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Thu, 10 Sep 2026 18:43:06 -0400 Subject: [PATCH 05/18] Another trivy version --- .github/workflows/docker-in-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-in-ci.yml b/.github/workflows/docker-in-ci.yml index 3046c55..12bfbfc 100644 --- a/.github/workflows/docker-in-ci.yml +++ b/.github/workflows/docker-in-ci.yml @@ -52,7 +52,7 @@ jobs: docker image inspect abcd-graph-full - name: Run Trivy vulnerability scanner - uses: aquasecurity/setup-trivy@v1 + uses: aquasecurity/trivy-action@v0.36.0 with: image-ref: 'abcd-graph-full' format: 'table' From 7c717b23340cb2df318e293784ca9a57510f37f9 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Thu, 10 Sep 2026 18:43:48 -0400 Subject: [PATCH 06/18] Another trivy version --- .github/workflows/docker-in-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-in-ci.yml b/.github/workflows/docker-in-ci.yml index 12bfbfc..c5b13b1 100644 --- a/.github/workflows/docker-in-ci.yml +++ b/.github/workflows/docker-in-ci.yml @@ -22,7 +22,7 @@ jobs: docker image inspect abcd-graph - name: Run Trivy vulnerability scanner - uses: aquasecurity/setup-trivy@v1 + uses: aquasecurity/trivy-action@v0.36.0 with: image-ref: 'abcd-graph' format: 'table' From 94232b38310c8e5873bcd03794fa22393d79b1ca Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Sat, 12 Sep 2026 08:33:49 -0400 Subject: [PATCH 07/18] Explicitly add libuuid --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 566f62c..a9f3e8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ RUN apk add --no-cache \ curl \ libffi-dev \ build-base \ - linux-headers + linux-headers \ + libuuid # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From 1adba0b32668083cb8b958778d31c07346cb899d Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Sat, 12 Sep 2026 08:39:32 -0400 Subject: [PATCH 08/18] Explicity min libuuid version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a9f3e8b..b722c9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN apk add --no-cache \ libffi-dev \ build-base \ linux-headers \ - libuuid + libuuid>=2.42.3-r1 # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From d711233dda44679ce0817e43084429a491d7a249 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Sat, 12 Sep 2026 09:02:50 -0400 Subject: [PATCH 09/18] Use pull flag in docker build --- .github/workflows/docker-in-ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-in-ci.yml b/.github/workflows/docker-in-ci.yml index c5b13b1..c6f66c6 100644 --- a/.github/workflows/docker-in-ci.yml +++ b/.github/workflows/docker-in-ci.yml @@ -2,6 +2,8 @@ name: docker on: pull_request: + branches: + - main push: branches: - main @@ -11,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Build docker basic image run: | - docker build -t abcd-graph . + docker build --pull -t abcd-graph . - name: Inspect basic docker image run: | @@ -41,11 +43,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Build docker full image run: | - docker build -t abcd-graph-full --build-arg INSTALL_TYPE=all . + docker build --pull -t abcd-graph-full --build-arg INSTALL_TYPE=all . - name: Inspect full docker image run: | From 95cc9f98f5bcf07e0914e0dccb0786a94a638054 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Wed, 16 Sep 2026 18:30:55 -0400 Subject: [PATCH 10/18] Add upgrade flag to apk install --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b722c9a..d26bb98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,12 @@ FROM python:3.12-alpine AS build # Install build tools + curl -RUN apk add --no-cache \ +RUN apk add --no-cache --upgrade \ bash \ curl \ libffi-dev \ build-base \ linux-headers \ - libuuid>=2.42.3-r1 # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From 1f65f263e1fd9dc9ff6c12b58a92593264e1b3e1 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Wed, 16 Sep 2026 18:32:17 -0400 Subject: [PATCH 11/18] Typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d26bb98..ab9cce7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk add --no-cache --upgrade \ curl \ libffi-dev \ build-base \ - linux-headers \ + linux-headers # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From 9a0100f1145f96f5be0301dc0b2b5ee104136f9e Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Wed, 16 Sep 2026 18:34:19 -0400 Subject: [PATCH 12/18] Explicilty install util-linux --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ab9cce7..db41116 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ RUN apk add --no-cache --upgrade \ curl \ libffi-dev \ build-base \ - linux-headers + linux-headers \ + util-linux # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From 924fdf7e494e8859df19879f3136ad40fad2e64c Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Wed, 16 Sep 2026 18:39:31 -0400 Subject: [PATCH 13/18] Back to libuuid package --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index db41116..02958d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN apk add --no-cache --upgrade \ libffi-dev \ build-base \ linux-headers \ - util-linux + libuuid>=2.42.3-r1 # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From 12cea2e373642d425a79855765a26b9b71533ad6 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Wed, 16 Sep 2026 18:42:13 -0400 Subject: [PATCH 14/18] Update apk before add --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 02958d9..6e54b3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.12-alpine AS build # Install build tools + curl -RUN apk add --no-cache --upgrade \ +RUN apk update && apk add --no-cache --upgrade \ bash \ curl \ libffi-dev \ From ffc1d4653b1234b0f08ba71f1c37f0e3335dea27 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Fri, 25 Sep 2026 08:51:11 -0400 Subject: [PATCH 15/18] Run update upgrade before install --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6e54b3a..e460c45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ FROM python:3.12-alpine AS build +# Upgrade apk package repo +RUN apk update && apk upgrade --no-cache + # Install build tools + curl -RUN apk update && apk add --no-cache --upgrade \ +RUN apk add --no-cache --upgrade \ bash \ curl \ libffi-dev \ From 7e87258605485e007b851bd3185d55b02558c196 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Fri, 25 Sep 2026 09:01:42 -0400 Subject: [PATCH 16/18] Remove explicit libuuid install --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e460c45..104e934 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ RUN apk add --no-cache --upgrade \ libffi-dev \ build-base \ linux-headers \ - libuuid>=2.42.3-r1 # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From b19ec41e42563e6c0cbce4a1a11e82b4b5d41d69 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Fri, 25 Sep 2026 09:02:42 -0400 Subject: [PATCH 17/18] Syntax bug --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 104e934..257d723 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN apk add --no-cache --upgrade \ curl \ libffi-dev \ build-base \ - linux-headers \ + linux-headers # Install uv and upgrade pip/setuptools RUN pip install --upgrade pip setuptools && pip install uv From 9dc2e68df83ff5af7f9fac44fb4e0495cd34b6d5 Mon Sep 17 00:00:00 2001 From: Ryan DeWolfe Date: Fri, 25 Sep 2026 09:07:34 -0400 Subject: [PATCH 18/18] Run ci on pr --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c80f5f7..cdabc6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: unit tests -on: [push] +on: [push, pull_request] jobs: test: runs-on: ${{ matrix.os }}