From f5d0b2c75fceab9e49804a5ac610da4bd3fb8d59 Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Thu, 9 Apr 2026 17:21:21 +0300 Subject: [PATCH 1/4] fix(ci): install workspace packages as editable + fix lint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ci.yml: use 'uv sync --all-packages' in test jobs so workspace members (coordinode, langchain-coordinode, llama-index-graph-stores-coordinode) are installed as proper editable packages via .pth files. Without this, uv sync only installs dev dependencies and leaves workspace packages uninstalled, causing ModuleNotFoundError in tests. - ruff.toml: update proto stubs exclude path to coordinode/coordinode/_proto/ (moved in #10); exclude _version.py (generated by hatch-vcs, unformatted) - tests/unit/test_types.py: fix I001 — remove blank line between same-group imports (pytest + coordinode._types are both third-party) - Makefile: clean target also removes coordinode/coordinode/_proto/google (google.api stubs generated alongside coordinode stubs) - Remove coordinode/_proto/__init__.py that was mistakenly committed to git (generated file, should only exist in gitignored coordinode/_proto/) --- .github/workflows/ci.yml | 4 ++-- Makefile | 2 +- coordinode/_proto/__init__.py | 2 -- ruff.toml | 4 +++- tests/unit/test_types.py | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 coordinode/_proto/__init__.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4d0e29..03a3a5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: uv sync + run: uv sync --all-packages - name: Generate proto stubs run: uv run make proto @@ -80,7 +80,7 @@ jobs: - name: Install + generate proto run: | - uv sync + uv sync --all-packages uv run make proto - name: Integration tests diff --git a/Makefile b/Makefile index d789a65..c7ce65f 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ lint: ruff format --check coordinode/ langchain-coordinode/ llama-index-coordinode/ tests/ clean: - rm -rf $(PROTO_OUT)/coordinode + rm -rf $(PROTO_OUT)/coordinode $(PROTO_OUT)/google find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true find . -type d -name dist -exec rm -rf {} + 2>/dev/null || true diff --git a/coordinode/_proto/__init__.py b/coordinode/_proto/__init__.py deleted file mode 100644 index cabe24e..0000000 --- a/coordinode/_proto/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated gRPC stubs. Run `make proto` to regenerate. -# This directory is .gitignore'd — stubs are not committed. diff --git a/ruff.toml b/ruff.toml index 1ecba6c..512e887 100644 --- a/ruff.toml +++ b/ruff.toml @@ -3,7 +3,9 @@ target-version = "py311" exclude = [ # Generated proto stubs — do not lint - "coordinode/_proto/", + "coordinode/coordinode/_proto/", + # Generated version files — do not lint + "_version.py", ] [lint] diff --git a/tests/unit/test_types.py b/tests/unit/test_types.py index d93195f..86459c1 100644 --- a/tests/unit/test_types.py +++ b/tests/unit/test_types.py @@ -6,7 +6,6 @@ """ import pytest - from coordinode._types import from_property_value, to_property_value # Detect whether proto stubs have been generated. From 579b1a89c1417d4d835e990cf91737b921813796 Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Thu, 9 Apr 2026 17:30:58 +0300 Subject: [PATCH 2/4] build(make): clean entire proto output dir instead of hardcoded subpaths --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c7ce65f..edf4ece 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ lint: ruff format --check coordinode/ langchain-coordinode/ llama-index-coordinode/ tests/ clean: - rm -rf $(PROTO_OUT)/coordinode $(PROTO_OUT)/google + rm -rf $(PROTO_OUT) find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true find . -type d -name dist -exec rm -rf {} + 2>/dev/null || true From 2a1b5422bf3003b4d1758687e8e229636fadab1a Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Thu, 9 Apr 2026 17:33:58 +0300 Subject: [PATCH 3/4] build(lint): exclude all generated _version.py files with glob pattern --- ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruff.toml b/ruff.toml index 512e887..826e431 100644 --- a/ruff.toml +++ b/ruff.toml @@ -5,7 +5,7 @@ exclude = [ # Generated proto stubs — do not lint "coordinode/coordinode/_proto/", # Generated version files — do not lint - "_version.py", + "**/_version.py", ] [lint] From a9f5964ef6306964f96348842f0f3ec1746d5e3c Mon Sep 17 00:00:00 2001 From: Dmitry Prudnikov Date: Thu, 9 Apr 2026 18:12:29 +0300 Subject: [PATCH 4/4] build(lint): configure isort known-first-party for deterministic import grouping Without explicit known-first-party, ruff classifies coordinode as third-party when the package is not installed as editable (e.g. plain `uv sync` in the lint job). This caused inconsistent blank-line requirements across test files. Setting known-first-party ensures consistent import grouping regardless of the install state. --- ruff.toml | 3 +++ tests/unit/test_types.py | 1 + 2 files changed, 4 insertions(+) diff --git a/ruff.toml b/ruff.toml index 826e431..2a07ca7 100644 --- a/ruff.toml +++ b/ruff.toml @@ -13,3 +13,6 @@ select = ["E", "F", "I", "W", "UP"] ignore = [ "E501", # line length handled by formatter ] + +[lint.isort] +known-first-party = ["coordinode", "langchain_coordinode", "llama_index_coordinode"] diff --git a/tests/unit/test_types.py b/tests/unit/test_types.py index 86459c1..d93195f 100644 --- a/tests/unit/test_types.py +++ b/tests/unit/test_types.py @@ -6,6 +6,7 @@ """ import pytest + from coordinode._types import from_property_value, to_property_value # Detect whether proto stubs have been generated.