From d7aa189571b26e3af9f3365df83e6044526156a0 Mon Sep 17 00:00:00 2001 From: Jiangzhou He Date: Mon, 17 Nov 2025 08:09:23 -0800 Subject: [PATCH 1/2] fix: prune installed features in workflow to avoid disk exceed limit --- .github/workflows/_test.yml | 5 +---- pyproject.toml | 24 ++++++++++-------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 3d5162e31..58febaebf 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -62,12 +62,9 @@ jobs: - name: Setup venv run: | python -m venv .venv - - name: Install Python toolchains - run: | - ${{ matrix.platform.python_exec }} -m pip install maturin mypy pytest pytest-asyncio - name: Python build run: | - ${{ matrix.platform.python_exec }} -m maturin develop --strip -E all + ${{ matrix.platform.python_exec }} -m maturin develop --strip -E dev - name: Python type check (mypy) run: | ${{ matrix.platform.python_exec }} -m mypy python diff --git a/pyproject.toml b/pyproject.toml index 5e352fdff..79718de74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,21 +64,22 @@ include = ["THIRD_PARTY_NOTICES.html"] manifest-path = "rust/cocoindex/Cargo.toml" [project.optional-dependencies] -dev = ["pytest", "pytest-asyncio", "ruff", "mypy", "pre-commit"] +dev = [ + "pytest", + "pytest-asyncio", + "ruff", + "mypy", + "pre-commit", + "pydantic>=2.11.9", +] embeddings = ["sentence-transformers>=3.3.1"] colpali = ["colpali-engine"] lancedb = ["lancedb>=0.25.0"] -pydantic = ["pydantic>=2.11.9"] # We need to repeat the dependency above to make it available for the `all` feature. # Indirect dependencies such as "cocoindex[embeddings]" will not work for local development. -all = [ - "sentence-transformers>=3.3.1", - "colpali-engine", - "lancedb>=0.25.0", - "pydantic>=2.11.9", -] +all = ["sentence-transformers>=3.3.1", "colpali-engine", "lancedb>=0.25.0"] [tool.mypy] python_version = "3.11" @@ -87,10 +88,5 @@ files = "python/cocoindex" exclude = "(\\.venv|site-packages)" disable_error_code = ["unused-ignore"] [[tool.mypy.overrides]] -module = [ - "sentence_transformers", - "torch", - "colpali_engine", - "PIL", -] +module = ["sentence_transformers", "torch", "colpali_engine", "PIL"] ignore_missing_imports = true From 4c6537c79a6a770a5414340821f668291e46e4ba Mon Sep 17 00:00:00 2001 From: Jiangzhou He Date: Mon, 17 Nov 2025 08:24:54 -0800 Subject: [PATCH 2/2] fix: explicitly install maturin --- .github/workflows/_test.yml | 5 ++++- pyproject.toml | 12 ++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 58febaebf..9415728d1 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -62,9 +62,12 @@ jobs: - name: Setup venv run: | python -m venv .venv + - name: Install Python toolchains + run: | + ${{ matrix.platform.python_exec }} -m pip install maturin - name: Python build run: | - ${{ matrix.platform.python_exec }} -m maturin develop --strip -E dev + ${{ matrix.platform.python_exec }} -m maturin develop --strip -E all-ci - name: Python type check (mypy) run: | ${{ matrix.platform.python_exec }} -m mypy python diff --git a/pyproject.toml b/pyproject.toml index 79718de74..7885eabd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,14 +64,7 @@ include = ["THIRD_PARTY_NOTICES.html"] manifest-path = "rust/cocoindex/Cargo.toml" [project.optional-dependencies] -dev = [ - "pytest", - "pytest-asyncio", - "ruff", - "mypy", - "pre-commit", - "pydantic>=2.11.9", -] +dev = ["pytest", "pytest-asyncio", "ruff", "mypy", "pre-commit"] embeddings = ["sentence-transformers>=3.3.1"] colpali = ["colpali-engine"] @@ -81,6 +74,9 @@ lancedb = ["lancedb>=0.25.0"] # Indirect dependencies such as "cocoindex[embeddings]" will not work for local development. all = ["sentence-transformers>=3.3.1", "colpali-engine", "lancedb>=0.25.0"] +# This is the set of dependencies that needs to be installed for the CI workflow. +all-ci = ["pytest", "pytest-asyncio", "mypy", "pydantic>=2.11.9"] + [tool.mypy] python_version = "3.11" strict = true