From c60627306f20b54a844b91b6753364dfa3e36998 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 14 Aug 2025 15:04:53 +0100 Subject: [PATCH 1/7] Refactor CI workflows to replace Poetry with uv for dependency management and execution --- .github/actions/cognee_setup/action.yml | 19 ++++--------- .github/workflows/basic_tests.yml | 10 +++---- .github/workflows/db_examples_tests.yml | 12 ++++---- .github/workflows/e2e_tests.yml | 28 +++++++++---------- .github/workflows/examples_tests.yml | 10 +++---- .github/workflows/graph_db_tests.yml | 12 ++++---- .github/workflows/python_version_tests.yml | 10 +++---- .../relational_db_migration_tests.yml | 12 ++++---- .github/workflows/reusable_notebook.yml | 4 +-- .github/workflows/search_db_tests.yml | 16 +++++------ .github/workflows/test_gemini.yml | 2 +- .github/workflows/test_ollama.yml | 4 +-- .github/workflows/test_s3_file_storage.yml | 2 +- .github/workflows/vector_db_tests.yml | 6 ++-- .github/workflows/weighted_edges_tests.yml | 12 ++++---- 15 files changed, 76 insertions(+), 83 deletions(-) diff --git a/.github/actions/cognee_setup/action.yml b/.github/actions/cognee_setup/action.yml index 8a3bbb7ef..e79619221 100644 --- a/.github/actions/cognee_setup/action.yml +++ b/.github/actions/cognee_setup/action.yml @@ -1,5 +1,5 @@ name: cognee-setup -description: "Sets up Python, installs Poetry, loads venv from cache, and installs dependencies for Cognee." +description: "Sets up Python, installs uv, and installs dependencies for Cognee." inputs: python-version: @@ -16,18 +16,11 @@ runs: with: python-version: ${{ inputs.python-version }} - - name: Install Poetry - shell: bash - run: | - python -m pip install --upgrade pip - pip install poetry - - - name: Rebuild Poetry lock file - shell: bash - run: | - rm poetry.lock - poetry lock + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true - name: Install dependencies shell: bash - run: poetry install --no-interaction -E api -E docs -E evals -E gemini -E codegraph -E ollama -E dev -E neo4j + run: uv sync --extra api --extra docs --extra evals --extra gemini --extra codegraph --extra ollama --extra dev --extra neo4j diff --git a/.github/workflows/basic_tests.yml b/.github/workflows/basic_tests.yml index 28c708ddb..2173b228e 100644 --- a/.github/workflows/basic_tests.yml +++ b/.github/workflows/basic_tests.yml @@ -98,7 +98,7 @@ jobs: python-version: ${{ inputs.python-version }} - name: Run Unit Tests - run: poetry run pytest cognee/tests/unit/ + run: uv run pytest cognee/tests/unit/ integration-tests: name: Run Integration Tests @@ -115,7 +115,7 @@ jobs: python-version: ${{ inputs.python-version }} - name: Run Integration Tests - run: poetry run pytest cognee/tests/integration/ + run: uv run pytest cognee/tests/integration/ simple-examples: name: Run Simple Examples @@ -144,7 +144,7 @@ jobs: python-version: ${{ inputs.python-version }} - name: Run Simple Examples - run: poetry run python ./examples/python/simple_example.py + run: uv run python ./examples/python/simple_example.py simple-examples-baml: name: Run Simple Examples BAML @@ -180,7 +180,7 @@ jobs: python-version: ${{ inputs.python-version }} - name: Run Simple Examples - run: poetry run python ./examples/python/simple_example.py + run: uv run python ./examples/python/simple_example.py graph-tests: name: Run Basic Graph Tests @@ -209,4 +209,4 @@ jobs: python-version: ${{ inputs.python-version }} - name: Run Graph Tests - run: poetry run python ./examples/python/code_graph_example.py --repo_path ./cognee/tasks/graph + run: uv run python ./examples/python/code_graph_example.py --repo_path ./cognee/tasks/graph diff --git a/.github/workflows/db_examples_tests.yml b/.github/workflows/db_examples_tests.yml index f585e8200..552395e6a 100644 --- a/.github/workflows/db_examples_tests.yml +++ b/.github/workflows/db_examples_tests.yml @@ -56,7 +56,7 @@ jobs: - name: Install Neo4j extra run: | - poetry install -E neo4j + uv sync --extra neo4j - name: Run Neo4j Example env: @@ -74,7 +74,7 @@ jobs: GRAPH_DATABASE_USERNAME: "neo4j" GRAPH_DATABASE_PASSWORD: ${{ secrets.NEO4J_API_KEY }} run: | - poetry run python examples/database_examples/neo4j_example.py + uv run python examples/database_examples/neo4j_example.py run-db-example-kuzu: name: "Kuzu DB Example Test" @@ -92,7 +92,7 @@ jobs: - name: Install Kuzu extra run: | - poetry install + uv sync - name: Run Kuzu Example env: @@ -107,7 +107,7 @@ jobs: EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} GRAPH_DATABASE_PROVIDER: "kuzu" run: | - poetry run python examples/database_examples/kuzu_example.py + uv run python examples/database_examples/kuzu_example.py run-db-example-pgvector: name: "PostgreSQL PGVector DB Example Test" @@ -141,7 +141,7 @@ jobs: - name: Install PGVector extra run: | - poetry install -E postgres + uv sync --extra postgres - name: Run PGVector Example env: @@ -155,4 +155,4 @@ jobs: EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} run: | - poetry run python examples/database_examples/pgvector_example.py + uv run python examples/database_examples/pgvector_example.py diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 99eb2a72c..4f7c67314 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -57,7 +57,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_cognee_server_start.py + run: uv run python ./cognee/tests/test_cognee_server_start.py run-telemetry-test: name: Run Telemetry Test @@ -81,7 +81,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_telemetry.py + run: uv run python ./cognee/tests/test_telemetry.py run-telemetry-pipeline-test: name: Run Telemetry Pipeline Test @@ -110,7 +110,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_library.py + run: uv run python ./cognee/tests/test_library.py run-deduplication-test: name: Deduplication Test @@ -143,7 +143,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E postgres + uv sync --extra postgres - name: Run Deduplication Example env: @@ -154,7 +154,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_deduplication.py + run: uv run python ./cognee/tests/test_deduplication.py run-deletion-test: name: Deletion Test @@ -179,7 +179,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_deletion.py + run: uv run python ./cognee/tests/test_deletion.py run-s3-bucket-test: name: S3 Bucket Test @@ -195,7 +195,7 @@ jobs: - name: Install specific S3 dependency run: | - poetry install -E aws + uv sync --extra aws - name: Run S3 Bucket Test env: @@ -210,7 +210,7 @@ jobs: EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: poetry run python ./cognee/tests/test_s3.py + run: uv run python ./cognee/tests/test_s3.py test-parallel-databases: name: Test using different async databases in parallel in Cognee @@ -226,7 +226,7 @@ jobs: - name: Install specific graph db dependency run: | - poetry install + uv sync - name: Run parallel databases test env: @@ -239,7 +239,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_parallel_databases.py + run: uv run python ./cognee/tests/test_parallel_databases.py test-permissions: name: Test permissions with different situations in Cognee @@ -255,7 +255,7 @@ jobs: - name: Install specific graph db dependency run: | - poetry install + uv sync - name: Run parallel databases test env: @@ -268,7 +268,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_permissions.py + run: uv run python ./cognee/tests/test_permissions.py test-graph-edges: name: Test graph edge ingestion @@ -284,7 +284,7 @@ jobs: - name: Install specific graph db dependency run: | - poetry install + uv sync - name: Run graph edges test env: @@ -297,4 +297,4 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_edge_ingestion.py + run: uv run python ./cognee/tests/test_edge_ingestion.py diff --git a/.github/workflows/examples_tests.yml b/.github/workflows/examples_tests.yml index 796faf2e0..f0ae430ec 100644 --- a/.github/workflows/examples_tests.yml +++ b/.github/workflows/examples_tests.yml @@ -20,7 +20,7 @@ jobs: env: LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: poetry run python ./examples/python/multimedia_example.py + run: uv run python ./examples/python/multimedia_example.py test-eval-example: name: Run Eval Example @@ -36,7 +36,7 @@ jobs: - name: Install specific eval dependency run: | - poetry install -E deepeval + uv sync --extra deepeval - name: Run Evaluation Framework Example env: @@ -49,7 +49,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/eval_framework/run_eval.py + run: uv run python ./cognee/eval_framework/run_eval.py test-descriptive-metrics: name: Run Descriptive Metrics Example @@ -74,7 +74,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/tasks/descriptive_metrics/networkx_metrics_test.py + run: uv run python ./cognee/tests/tasks/descriptive_metrics/networkx_metrics_test.py test-dynamic-steps-metrics: @@ -100,4 +100,4 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./examples/python/dynamic_steps_example.py + run: uv run python ./examples/python/dynamic_steps_example.py diff --git a/.github/workflows/graph_db_tests.yml b/.github/workflows/graph_db_tests.yml index 379539e14..91a611168 100644 --- a/.github/workflows/graph_db_tests.yml +++ b/.github/workflows/graph_db_tests.yml @@ -30,7 +30,7 @@ jobs: - name: Install specific db dependency run: | - poetry install + uv sync - name: Run Kuzu Tests env: @@ -43,7 +43,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_kuzu.py + run: uv run python ./cognee/tests/test_kuzu.py - name: Run Weighted Edges Tests with Kuzu env: @@ -57,7 +57,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v + run: uv run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v run-neo4j-tests: name: Neo4j Tests @@ -74,7 +74,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E neo4j + uv sync --extra neo4j - name: Run default Neo4j env: @@ -91,7 +91,7 @@ jobs: GRAPH_DATABASE_URL: ${{ secrets.NEO4J_API_URL }} GRAPH_DATABASE_PASSWORD: ${{ secrets.NEO4J_API_KEY }} GRAPH_DATABASE_USERNAME: "neo4j" - run: poetry run python ./cognee/tests/test_neo4j.py + run: uv run python ./cognee/tests/test_neo4j.py - name: Run Weighted Edges Tests with Neo4j env: @@ -108,4 +108,4 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v + run: uv run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v diff --git a/.github/workflows/python_version_tests.yml b/.github/workflows/python_version_tests.yml index 6db67d115..d7a7da050 100644 --- a/.github/workflows/python_version_tests.yml +++ b/.github/workflows/python_version_tests.yml @@ -55,7 +55,7 @@ jobs: - name: Run unit tests shell: bash - run: poetry run pytest cognee/tests/unit/ + run: uv run pytest cognee/tests/unit/ env: PYTHONUTF8: 1 LLM_PROVIDER: openai @@ -73,7 +73,7 @@ jobs: - name: Run integration tests if: ${{ !contains(matrix.os, 'windows') }} shell: bash - run: poetry run pytest cognee/tests/integration/ + run: uv run pytest cognee/tests/integration/ env: PYTHONUTF8: 1 LLM_PROVIDER: openai @@ -103,11 +103,11 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_library.py + run: uv run python ./cognee/tests/test_library.py - - name: Build with Poetry + - name: Build with uv shell: bash - run: poetry build + run: uv build - name: Install Package if: ${{ !contains(matrix.os, 'windows') }} diff --git a/.github/workflows/relational_db_migration_tests.yml b/.github/workflows/relational_db_migration_tests.yml index e44d54d02..604964512 100644 --- a/.github/workflows/relational_db_migration_tests.yml +++ b/.github/workflows/relational_db_migration_tests.yml @@ -61,7 +61,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E postgres + uv sync --extra postgres - name: Run PostgreSQL Script to create test data (Chinook_PostgreSql.sql) env: @@ -90,7 +90,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_relational_db_migration.py + run: uv run python ./cognee/tests/test_relational_db_migration.py run-relational-db-migration-test-kuzu: name: Kuzu Relational DB Migration Test @@ -123,7 +123,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E postgres + uv sync --extra postgres - name: Run PostgreSQL Script to create test data (Chinook_PostgreSql.sql) env: @@ -154,7 +154,7 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_relational_db_migration.py + run: uv run python ./cognee/tests/test_relational_db_migration.py run-relational-db-migration-test-neo4j: name: Neo4j Relational DB Migration Test @@ -187,7 +187,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E postgres -E neo4j + uv sync --extra postgres --extra neo4j - name: Run PostgreSQL Script to create test data (Chinook_PostgreSql.sql) env: @@ -221,4 +221,4 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_relational_db_migration.py + run: uv run python ./cognee/tests/test_relational_db_migration.py diff --git a/.github/workflows/reusable_notebook.yml b/.github/workflows/reusable_notebook.yml index 4f97476ef..7ee7f61f3 100644 --- a/.github/workflows/reusable_notebook.yml +++ b/.github/workflows/reusable_notebook.yml @@ -49,7 +49,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E notebook + uv sync --extra notebook - name: Execute Jupyter Notebook env: @@ -64,7 +64,7 @@ jobs: EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} run: | - poetry run jupyter nbconvert \ + uv run jupyter nbconvert \ --to notebook \ --execute ${{ inputs.notebook-location }} \ --output executed_notebook.ipynb \ diff --git a/.github/workflows/search_db_tests.yml b/.github/workflows/search_db_tests.yml index 3f4bbf1ca..a2ab00754 100644 --- a/.github/workflows/search_db_tests.yml +++ b/.github/workflows/search_db_tests.yml @@ -30,7 +30,7 @@ jobs: - name: Install specific db dependency run: | - poetry install + uv sync - name: Run Kuzu search Tests env: @@ -46,7 +46,7 @@ jobs: GRAPH_DATABASE_PROVIDER: 'kuzu' VECTOR_DB_PROVIDER: 'lancedb' DB_PROVIDER: 'sqlite' - run: poetry run python ./cognee/tests/test_search_db.py + run: uv run python ./cognee/tests/test_search_db.py run-neo4j-lance-sqlite-search-tests: name: Search test for Neo4j/LanceDB/Sqlite @@ -80,7 +80,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E neo4j + uv sync --extra neo4j - name: Run Neo4j search Tests env: @@ -99,7 +99,7 @@ jobs: GRAPH_DATABASE_URL: bolt://localhost:7687 GRAPH_DATABASE_USERNAME: neo4j GRAPH_DATABASE_PASSWORD: pleaseletmein - run: poetry run python ./cognee/tests/test_search_db.py + run: uv run python ./cognee/tests/test_search_db.py run-kuzu-pgvector-postgres-search-tests: name: Search test for Kuzu/PGVector/Postgres @@ -131,7 +131,7 @@ jobs: python-version: ${{ inputs.python-version }} - name: Install dependencies - run: poetry install -E postgres + run: uv sync --extra postgres - name: Run Kuzu/PGVector/Postgres Tests env: @@ -152,7 +152,7 @@ jobs: DB_PORT: 5432 DB_USERNAME: cognee DB_PASSWORD: cognee - run: poetry run python ./cognee/tests/test_search_db.py + run: uv run python ./cognee/tests/test_search_db.py run-neo4j-pgvector-postgres-search-tests: name: Search test for Neo4j/PGVector/Postgres @@ -198,7 +198,7 @@ jobs: - name: Install dependencies run: | - poetry install -E neo4j -E postgres + uv sync --extra neo4j --extra postgres - name: Run Neo4j + PGVector + Postgres search Tests env: @@ -222,4 +222,4 @@ jobs: DB_PORT: 5432 DB_USERNAME: cognee DB_PASSWORD: cognee - run: poetry run python ./cognee/tests/test_search_db.py + run: uv run python ./cognee/tests/test_search_db.py diff --git a/.github/workflows/test_gemini.yml b/.github/workflows/test_gemini.yml index 41fd954a2..544e15a5e 100644 --- a/.github/workflows/test_gemini.yml +++ b/.github/workflows/test_gemini.yml @@ -26,4 +26,4 @@ jobs: EMBEDDING_MODEL: "gemini/text-embedding-004" EMBEDDING_DIMENSIONS: "768" EMBEDDING_MAX_TOKENS: "8076" - run: poetry run python ./examples/python/simple_example.py + run: uv run python ./examples/python/simple_example.py diff --git a/.github/workflows/test_ollama.yml b/.github/workflows/test_ollama.yml index 8f85efadc..fbd687319 100644 --- a/.github/workflows/test_ollama.yml +++ b/.github/workflows/test_ollama.yml @@ -26,7 +26,7 @@ jobs: - name: Install torch dependency run: | - poetry add torch + uv add torch # - name: Install ollama # run: curl -fsSL https://ollama.com/install.sh | sh @@ -101,4 +101,4 @@ jobs: EMBEDDING_ENDPOINT: "http://localhost:11434/api/embeddings" EMBEDDING_DIMENSIONS: "4096" HUGGINGFACE_TOKENIZER: "Salesforce/SFR-Embedding-Mistral" - run: poetry run python ./examples/python/simple_example.py + run: uv run python ./examples/python/simple_example.py diff --git a/.github/workflows/test_s3_file_storage.yml b/.github/workflows/test_s3_file_storage.yml index 8035a9bc3..c4866ec2d 100644 --- a/.github/workflows/test_s3_file_storage.yml +++ b/.github/workflows/test_s3_file_storage.yml @@ -36,4 +36,4 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_s3_file_storage.py + run: uv run python ./cognee/tests/test_s3_file_storage.py diff --git a/.github/workflows/vector_db_tests.yml b/.github/workflows/vector_db_tests.yml index 00ce21cbf..faa570868 100644 --- a/.github/workflows/vector_db_tests.yml +++ b/.github/workflows/vector_db_tests.yml @@ -56,7 +56,7 @@ jobs: # EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} # EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} # EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - # run: poetry run python ./cognee/tests/test_chromadb.py + # run: uv run python ./cognee/tests/test_chromadb.py run-postgres-tests: @@ -90,7 +90,7 @@ jobs: - name: Install specific db dependency run: | - poetry install -E postgres + uv sync --extra postgres - name: Run PGVector Tests env: @@ -103,4 +103,4 @@ jobs: EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }} EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} - run: poetry run python ./cognee/tests/test_pgvector.py + run: uv run python ./cognee/tests/test_pgvector.py diff --git a/.github/workflows/weighted_edges_tests.yml b/.github/workflows/weighted_edges_tests.yml index d33bd1ceb..6d33082a9 100644 --- a/.github/workflows/weighted_edges_tests.yml +++ b/.github/workflows/weighted_edges_tests.yml @@ -47,11 +47,11 @@ jobs: - name: Run Weighted Edges Unit Tests run: | - poetry run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v --tb=short + uv run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v --tb=short - name: Run Standard Graph Tests (Regression) run: | - poetry run pytest cognee/tests/unit/interfaces/graph/get_graph_from_model_unit_test.py -v --tb=short + uv run pytest cognee/tests/unit/interfaces/graph/get_graph_from_model_unit_test.py -v --tb=short test-with-different-databases: name: Test Weighted Edges with Different Graph Databases @@ -64,7 +64,7 @@ jobs: install_extra: "" graph_db_provider: "kuzu" - database: neo4j - install_extra: "-E neo4j" + install_extra: "--extra neo4j" graph_db_provider: "neo4j" env: LLM_PROVIDER: openai @@ -90,13 +90,13 @@ jobs: - name: Install Database Dependencies run: | - poetry install ${{ matrix.install_extra }} + uv sync ${{ matrix.install_extra }} - name: Run Weighted Edges Tests env: GRAPH_DATABASE_PROVIDER: ${{ matrix.graph_db_provider }} run: | - poetry run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v --tb=short + uv run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v --tb=short test-examples: name: Test Weighted Edges Examples @@ -125,7 +125,7 @@ jobs: - name: Test Weighted Edges Example run: | - poetry run python examples/python/weighted_edges_example.py + uv run python examples/python/weighted_edges_example.py - name: Verify Visualization File Created run: | From cb5590b655677311b6c64af8b8fc4f5999d711b8 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 14 Aug 2025 15:16:03 +0100 Subject: [PATCH 2/7] Update installation instructions and replace Poetry with uv across documentation and scripts --- README.md | 4 ++-- cognee-gui.py | 8 ++++---- cognee-mcp/README.md | 2 +- deployment/helm/Dockerfile | 17 ++++++----------- deployment/setup_ubuntu_instance.sh | 4 ++-- distributed/Dockerfile | 9 +++------ tools/check-lockfile.py | 4 ++-- 7 files changed, 20 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 194ede720..8f160727e 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Your contributions are at the core of making this a true open source project. An ## 📦 Installation -You can install Cognee using either **pip**, **poetry**, **uv** or any other python package manager. +You can install Cognee using either **uv**, **pip**, **poetry** or any other python package manager. Cognee supports Python 3.8 to 3.12 ### With pip @@ -102,7 +102,7 @@ pip install cognee ## Local Cognee installation -You can install the local Cognee repo using **pip**, **poetry** and **uv**. +You can install the local Cognee repo using **uv**, **pip** and **poetry**. For local pip installation please make sure your pip version is above version 21.3. ### with UV with all optional dependencies diff --git a/cognee-gui.py b/cognee-gui.py index e62a08380..d08d31529 100644 --- a/cognee-gui.py +++ b/cognee-gui.py @@ -23,10 +23,10 @@ except ImportError as e: print( "\nPlease install Cognee with optional gui dependencies or manually install missing dependencies.\n" ) - print("\nTo install with poetry use:") - print("\npoetry install -E gui\n") - print("\nOr to install with poetry and all dependencies use:") - print("\npoetry install --all-extras\n") + print("\nTo install with uv use:") + print("\nuv sync --extra gui\n") + print("\nOr to install with uv and all dependencies use:") + print("\nuv sync --all-extras\n") print("\nTo install with pip use: ") print('\npip install ".[gui]"\n') raise e diff --git a/cognee-mcp/README.md b/cognee-mcp/README.md index ffd46dd6e..ecb7a0f4b 100644 --- a/cognee-mcp/README.md +++ b/cognee-mcp/README.md @@ -211,7 +211,7 @@ Open inspector with timeout passed: To apply new changes while developing cognee you need to do: -1. `poetry lock` in cognee folder +1. `uv lock` in cognee folder 2. `uv sync --dev --all-extras --reinstall` 3. `mcp dev src/server.py` diff --git a/deployment/helm/Dockerfile b/deployment/helm/Dockerfile index 3f9ec7740..e6cdc81f0 100644 --- a/deployment/helm/Dockerfile +++ b/deployment/helm/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.11-slim -# Define Poetry extras to install -ARG POETRY_EXTRAS="\ +# Define uv extras to install +ARG UV_EXTRAS="\ # Storage & Databases \ postgres neo4j falkordb kuzu \ # Notebooks & Interactive Environments \ @@ -21,7 +21,6 @@ ARG DEBUG # Set environment variable based on the build argument ENV DEBUG=${DEBUG} ENV PIP_NO_CACHE_DIR=true -ENV PATH="${PATH}:/root/.poetry/bin" RUN apt-get install -y \ @@ -30,16 +29,12 @@ RUN apt-get install -y \ WORKDIR /app -COPY pyproject.toml poetry.lock /app/ +COPY pyproject.toml uv.lock /app/ +RUN pip install uv -RUN pip install poetry - -# Don't create virtualenv since docker is already isolated -RUN poetry config virtualenvs.create false - -# Install the dependencies -RUN poetry install --extras "${POETRY_EXTRAS}" --no-root --without dev +# Install the dependencies with uv +RUN uv sync --no-dev # Set the PYTHONPATH environment variable to include the /app directory diff --git a/deployment/setup_ubuntu_instance.sh b/deployment/setup_ubuntu_instance.sh index 854cd1c9f..c54e8f3f2 100644 --- a/deployment/setup_ubuntu_instance.sh +++ b/deployment/setup_ubuntu_instance.sh @@ -26,5 +26,5 @@ sudo apt install -y python3.12 virtualenv venv --python=python3.12 source venv/bin/activate -pip install poetry -poetry install +pip install uv +uv sync diff --git a/distributed/Dockerfile b/distributed/Dockerfile index 6ac818d45..6a5fb0ccb 100644 --- a/distributed/Dockerfile +++ b/distributed/Dockerfile @@ -2,7 +2,6 @@ FROM python:3.11-slim # Set environment variables ENV PIP_NO_CACHE_DIR=true -ENV PATH="${PATH}:/root/.poetry/bin" ENV PYTHONPATH=/app ENV RUN_MODE=modal ENV SKIP_MIGRATIONS=true @@ -19,13 +18,11 @@ RUN apt-get update && apt-get install -y \ WORKDIR /app -COPY pyproject.toml poetry.lock README.md /app/ +COPY pyproject.toml uv.lock README.md /app/ -RUN pip install poetry +RUN pip install uv -RUN poetry config virtualenvs.create false - -RUN poetry install --extras neo4j --extras postgres --extras aws --extras distributed --no-root +RUN uv sync --extra neo4j --extra postgres --extra aws --extra distributed --no-dev COPY cognee/ /app/cognee COPY distributed/ /app/distributed diff --git a/tools/check-lockfile.py b/tools/check-lockfile.py index df60b35ac..39bea1165 100644 --- a/tools/check-lockfile.py +++ b/tools/check-lockfile.py @@ -1,7 +1,7 @@ import sys # File and string to search for -lockfile_name = "poetry.lock" +lockfile_name = "uv.lock" hash_string = "hash = " threshold = 100 @@ -19,7 +19,7 @@ try: # If the loop completes without early exit, it means the threshold was not reached print( - f"Error: The string '{hash_string}' appears less than {threshold} times in {lockfile_name}, please make sure you are using an up to date poetry version." + f"Error: The string '{hash_string}' appears less than {threshold} times in {lockfile_name}, please make sure you are using an up to date uv version." ) sys.exit(1) From a1edfc98c2025beca85af87439e7cf703faf85da Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 14 Aug 2025 15:17:00 +0100 Subject: [PATCH 3/7] docs: update README.md with new supported python versions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f160727e..6f4cac325 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Your contributions are at the core of making this a true open source project. An ## 📦 Installation You can install Cognee using either **uv**, **pip**, **poetry** or any other python package manager. -Cognee supports Python 3.8 to 3.12 +Cognee supports Python 3.10 to 3.13 ### With pip From 1ab332828f61b5da6313f3dd7b9c4e92bf7e8df7 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 14 Aug 2025 15:43:44 +0100 Subject: [PATCH 4/7] fix: uv uninstalls rest of packages in some workflows --- .github/actions/cognee_setup/action.yml | 14 +++++++++++++- .github/workflows/db_examples_tests.yml | 9 +-------- .github/workflows/e2e_tests.yml | 11 ++++------- .github/workflows/examples_tests.yml | 5 +---- .github/workflows/graph_db_tests.yml | 4 ---- .../workflows/relational_db_migration_tests.yml | 12 ++++++------ .github/workflows/reusable_notebook.yml | 5 +---- .github/workflows/search_db_tests.yml | 16 ++++++++-------- .github/workflows/vector_db_tests.yml | 5 +---- 9 files changed, 35 insertions(+), 46 deletions(-) diff --git a/.github/actions/cognee_setup/action.yml b/.github/actions/cognee_setup/action.yml index e79619221..869582585 100644 --- a/.github/actions/cognee_setup/action.yml +++ b/.github/actions/cognee_setup/action.yml @@ -6,6 +6,10 @@ inputs: description: "Which Python version to use" required: false default: "3.11.x" + extra-dependencies: + description: "Additional extra dependencies to install (space-separated)" + required: false + default: "" runs: using: "composite" @@ -23,4 +27,12 @@ runs: - name: Install dependencies shell: bash - run: uv sync --extra api --extra docs --extra evals --extra gemini --extra codegraph --extra ollama --extra dev --extra neo4j + run: | + EXTRA_ARGS="" + if [ -n "${{ inputs.extra-dependencies }}" ]; then + IFS=' ' read -r -a deps <<< "${{ inputs.extra-dependencies }}" + for extra in "${deps[@]}"; do + EXTRA_ARGS="$EXTRA_ARGS --extra $extra" + done + fi + uv sync --extra api --extra docs --extra evals --extra gemini --extra codegraph --extra ollama --extra dev --extra neo4j $EXTRA_ARGS diff --git a/.github/workflows/db_examples_tests.yml b/.github/workflows/db_examples_tests.yml index 552395e6a..ae61d2ab0 100644 --- a/.github/workflows/db_examples_tests.yml +++ b/.github/workflows/db_examples_tests.yml @@ -54,10 +54,6 @@ jobs: with: python-version: ${{ inputs.python-version }} - - name: Install Neo4j extra - run: | - uv sync --extra neo4j - - name: Run Neo4j Example env: ENV: dev @@ -138,10 +134,7 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: ${{ inputs.python-version }} - - - name: Install PGVector extra - run: | - uv sync --extra postgres + extra-dependencies: "postgres" - name: Run PGVector Example env: diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 4f7c67314..8caeca5c3 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -140,10 +140,7 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: '3.11.x' - - - name: Install specific db dependency - run: | - uv sync --extra postgres + extra-dependencies: "postgres" - name: Run Deduplication Example env: @@ -192,10 +189,10 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: '3.11.x' + extra-dependencies: "aws" - - name: Install specific S3 dependency - run: | - uv sync --extra aws + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run S3 Bucket Test env: diff --git a/.github/workflows/examples_tests.yml b/.github/workflows/examples_tests.yml index f0ae430ec..277ed8c21 100644 --- a/.github/workflows/examples_tests.yml +++ b/.github/workflows/examples_tests.yml @@ -33,10 +33,7 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: '3.11.x' - - - name: Install specific eval dependency - run: | - uv sync --extra deepeval + extra-dependencies: "deepeval" - name: Run Evaluation Framework Example env: diff --git a/.github/workflows/graph_db_tests.yml b/.github/workflows/graph_db_tests.yml index 91a611168..fe8fec4f0 100644 --- a/.github/workflows/graph_db_tests.yml +++ b/.github/workflows/graph_db_tests.yml @@ -72,10 +72,6 @@ jobs: with: python-version: ${{ inputs.python-version }} - - name: Install specific db dependency - run: | - uv sync --extra neo4j - - name: Run default Neo4j env: ENV: 'dev' diff --git a/.github/workflows/relational_db_migration_tests.yml b/.github/workflows/relational_db_migration_tests.yml index 604964512..26fd7e150 100644 --- a/.github/workflows/relational_db_migration_tests.yml +++ b/.github/workflows/relational_db_migration_tests.yml @@ -58,10 +58,10 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: '3.11.x' + extra-dependencies: "postgres" - name: Install specific db dependency - run: | - uv sync --extra postgres + run: echo "Dependencies already installed in setup" - name: Run PostgreSQL Script to create test data (Chinook_PostgreSql.sql) env: @@ -120,10 +120,10 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: '3.11.x' + extra-dependencies: "postgres" - name: Install specific db dependency - run: | - uv sync --extra postgres + run: echo "Dependencies already installed in setup" - name: Run PostgreSQL Script to create test data (Chinook_PostgreSql.sql) env: @@ -184,10 +184,10 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: '3.11.x' + extra-dependencies: "postgres" - name: Install specific db dependency - run: | - uv sync --extra postgres --extra neo4j + run: echo "Dependencies already installed in setup" - name: Run PostgreSQL Script to create test data (Chinook_PostgreSql.sql) env: diff --git a/.github/workflows/reusable_notebook.yml b/.github/workflows/reusable_notebook.yml index 7ee7f61f3..8eaf7ce3a 100644 --- a/.github/workflows/reusable_notebook.yml +++ b/.github/workflows/reusable_notebook.yml @@ -46,10 +46,7 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: ${{ inputs.python-version }} - - - name: Install specific db dependency - run: | - uv sync --extra notebook + extra-dependencies: "notebook" - name: Execute Jupyter Notebook env: diff --git a/.github/workflows/search_db_tests.yml b/.github/workflows/search_db_tests.yml index a2ab00754..c468bd1c6 100644 --- a/.github/workflows/search_db_tests.yml +++ b/.github/workflows/search_db_tests.yml @@ -78,9 +78,8 @@ jobs: with: python-version: ${{ inputs.python-version }} - - name: Install specific db dependency - run: | - uv sync --extra neo4j + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Neo4j search Tests env: @@ -129,9 +128,10 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: ${{ inputs.python-version }} + extra-dependencies: "postgres" - - name: Install dependencies - run: uv sync --extra postgres + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Kuzu/PGVector/Postgres Tests env: @@ -195,10 +195,10 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: ${{ inputs.python-version }} + extra-dependencies: "postgres" - - name: Install dependencies - run: | - uv sync --extra neo4j --extra postgres + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Neo4j + PGVector + Postgres search Tests env: diff --git a/.github/workflows/vector_db_tests.yml b/.github/workflows/vector_db_tests.yml index faa570868..a82194db3 100644 --- a/.github/workflows/vector_db_tests.yml +++ b/.github/workflows/vector_db_tests.yml @@ -87,10 +87,7 @@ jobs: uses: ./.github/actions/cognee_setup with: python-version: ${{ inputs.python-version }} - - - name: Install specific db dependency - run: | - uv sync --extra postgres + extra-dependencies: "postgres" - name: Run PGVector Tests env: From bcdbadc4686148d4e7fd598df36bad03ae4327e2 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 14 Aug 2025 16:03:16 +0100 Subject: [PATCH 5/7] fix: unintentionally uninstall required deps when "uv sync" --- .github/workflows/db_examples_tests.yml | 5 ++--- .github/workflows/e2e_tests.yml | 15 ++++++--------- .github/workflows/graph_db_tests.yml | 5 ++--- .github/workflows/search_db_tests.yml | 5 ++--- .github/workflows/weighted_edges_tests.yml | 7 ++----- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/db_examples_tests.yml b/.github/workflows/db_examples_tests.yml index ae61d2ab0..a1a81b4d4 100644 --- a/.github/workflows/db_examples_tests.yml +++ b/.github/workflows/db_examples_tests.yml @@ -86,9 +86,8 @@ jobs: with: python-version: ${{ inputs.python-version }} - - name: Install Kuzu extra - run: | - uv sync + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Kuzu Example env: diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 8caeca5c3..54a7cf98c 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -221,9 +221,8 @@ jobs: with: python-version: '3.11.x' - - name: Install specific graph db dependency - run: | - uv sync + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run parallel databases test env: @@ -250,9 +249,8 @@ jobs: with: python-version: '3.11.x' - - name: Install specific graph db dependency - run: | - uv sync + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run parallel databases test env: @@ -279,9 +277,8 @@ jobs: with: python-version: '3.11.x' - - name: Install specific graph db dependency - run: | - uv sync + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run graph edges test env: diff --git a/.github/workflows/graph_db_tests.yml b/.github/workflows/graph_db_tests.yml index fe8fec4f0..e7e5a11b8 100644 --- a/.github/workflows/graph_db_tests.yml +++ b/.github/workflows/graph_db_tests.yml @@ -28,9 +28,8 @@ jobs: with: python-version: ${{ inputs.python-version }} - - name: Install specific db dependency - run: | - uv sync + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Kuzu Tests env: diff --git a/.github/workflows/search_db_tests.yml b/.github/workflows/search_db_tests.yml index c468bd1c6..0b749526d 100644 --- a/.github/workflows/search_db_tests.yml +++ b/.github/workflows/search_db_tests.yml @@ -28,9 +28,8 @@ jobs: with: python-version: ${{ inputs.python-version }} - - name: Install specific db dependency - run: | - uv sync + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Kuzu search Tests env: diff --git a/.github/workflows/weighted_edges_tests.yml b/.github/workflows/weighted_edges_tests.yml index 6d33082a9..555660caa 100644 --- a/.github/workflows/weighted_edges_tests.yml +++ b/.github/workflows/weighted_edges_tests.yml @@ -61,10 +61,8 @@ jobs: database: ['kuzu', 'neo4j'] include: - database: kuzu - install_extra: "" graph_db_provider: "kuzu" - database: neo4j - install_extra: "--extra neo4j" graph_db_provider: "neo4j" env: LLM_PROVIDER: openai @@ -88,9 +86,8 @@ jobs: with: python-version: '3.11' - - name: Install Database Dependencies - run: | - uv sync ${{ matrix.install_extra }} + - name: Dependencies already installed + run: echo "Dependencies already installed in setup" - name: Run Weighted Edges Tests env: From 3941e469e5132aa89d4fb8d09e7a7bb539feb878 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Fri, 15 Aug 2025 09:41:40 +0100 Subject: [PATCH 6/7] chore: add step to rebuild uv lockfile in CI workflow --- .github/actions/cognee_setup/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/cognee_setup/action.yml b/.github/actions/cognee_setup/action.yml index 869582585..9ae669b53 100644 --- a/.github/actions/cognee_setup/action.yml +++ b/.github/actions/cognee_setup/action.yml @@ -24,6 +24,12 @@ runs: uses: astral-sh/setup-uv@v4 with: enable-cache: true + + - name: Rebuild uv lockfile + shell: bash + run: | + rm uv.lock + uv lock - name: Install dependencies shell: bash From 4312508cf3f0c78eccd435d949d4c58af1d7e186 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Fri, 15 Aug 2025 09:45:25 +0100 Subject: [PATCH 7/7] undo: keep poetry-uv change limited to CI/CD fo now --- cognee-gui.py | 8 ++++---- cognee-mcp/README.md | 2 +- deployment/helm/Dockerfile | 17 +++++++++++------ deployment/setup_ubuntu_instance.sh | 4 ++-- distributed/Dockerfile | 9 ++++++--- tools/check-lockfile.py | 4 ++-- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/cognee-gui.py b/cognee-gui.py index d08d31529..e62a08380 100644 --- a/cognee-gui.py +++ b/cognee-gui.py @@ -23,10 +23,10 @@ except ImportError as e: print( "\nPlease install Cognee with optional gui dependencies or manually install missing dependencies.\n" ) - print("\nTo install with uv use:") - print("\nuv sync --extra gui\n") - print("\nOr to install with uv and all dependencies use:") - print("\nuv sync --all-extras\n") + print("\nTo install with poetry use:") + print("\npoetry install -E gui\n") + print("\nOr to install with poetry and all dependencies use:") + print("\npoetry install --all-extras\n") print("\nTo install with pip use: ") print('\npip install ".[gui]"\n') raise e diff --git a/cognee-mcp/README.md b/cognee-mcp/README.md index ecb7a0f4b..ffd46dd6e 100644 --- a/cognee-mcp/README.md +++ b/cognee-mcp/README.md @@ -211,7 +211,7 @@ Open inspector with timeout passed: To apply new changes while developing cognee you need to do: -1. `uv lock` in cognee folder +1. `poetry lock` in cognee folder 2. `uv sync --dev --all-extras --reinstall` 3. `mcp dev src/server.py` diff --git a/deployment/helm/Dockerfile b/deployment/helm/Dockerfile index e6cdc81f0..3f9ec7740 100644 --- a/deployment/helm/Dockerfile +++ b/deployment/helm/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.11-slim -# Define uv extras to install -ARG UV_EXTRAS="\ +# Define Poetry extras to install +ARG POETRY_EXTRAS="\ # Storage & Databases \ postgres neo4j falkordb kuzu \ # Notebooks & Interactive Environments \ @@ -21,6 +21,7 @@ ARG DEBUG # Set environment variable based on the build argument ENV DEBUG=${DEBUG} ENV PIP_NO_CACHE_DIR=true +ENV PATH="${PATH}:/root/.poetry/bin" RUN apt-get install -y \ @@ -29,12 +30,16 @@ RUN apt-get install -y \ WORKDIR /app -COPY pyproject.toml uv.lock /app/ +COPY pyproject.toml poetry.lock /app/ -RUN pip install uv -# Install the dependencies with uv -RUN uv sync --no-dev +RUN pip install poetry + +# Don't create virtualenv since docker is already isolated +RUN poetry config virtualenvs.create false + +# Install the dependencies +RUN poetry install --extras "${POETRY_EXTRAS}" --no-root --without dev # Set the PYTHONPATH environment variable to include the /app directory diff --git a/deployment/setup_ubuntu_instance.sh b/deployment/setup_ubuntu_instance.sh index c54e8f3f2..854cd1c9f 100644 --- a/deployment/setup_ubuntu_instance.sh +++ b/deployment/setup_ubuntu_instance.sh @@ -26,5 +26,5 @@ sudo apt install -y python3.12 virtualenv venv --python=python3.12 source venv/bin/activate -pip install uv -uv sync +pip install poetry +poetry install diff --git a/distributed/Dockerfile b/distributed/Dockerfile index 6a5fb0ccb..6ac818d45 100644 --- a/distributed/Dockerfile +++ b/distributed/Dockerfile @@ -2,6 +2,7 @@ FROM python:3.11-slim # Set environment variables ENV PIP_NO_CACHE_DIR=true +ENV PATH="${PATH}:/root/.poetry/bin" ENV PYTHONPATH=/app ENV RUN_MODE=modal ENV SKIP_MIGRATIONS=true @@ -18,11 +19,13 @@ RUN apt-get update && apt-get install -y \ WORKDIR /app -COPY pyproject.toml uv.lock README.md /app/ +COPY pyproject.toml poetry.lock README.md /app/ -RUN pip install uv +RUN pip install poetry -RUN uv sync --extra neo4j --extra postgres --extra aws --extra distributed --no-dev +RUN poetry config virtualenvs.create false + +RUN poetry install --extras neo4j --extras postgres --extras aws --extras distributed --no-root COPY cognee/ /app/cognee COPY distributed/ /app/distributed diff --git a/tools/check-lockfile.py b/tools/check-lockfile.py index 39bea1165..df60b35ac 100644 --- a/tools/check-lockfile.py +++ b/tools/check-lockfile.py @@ -1,7 +1,7 @@ import sys # File and string to search for -lockfile_name = "uv.lock" +lockfile_name = "poetry.lock" hash_string = "hash = " threshold = 100 @@ -19,7 +19,7 @@ try: # If the loop completes without early exit, it means the threshold was not reached print( - f"Error: The string '{hash_string}' appears less than {threshold} times in {lockfile_name}, please make sure you are using an up to date uv version." + f"Error: The string '{hash_string}' appears less than {threshold} times in {lockfile_name}, please make sure you are using an up to date poetry version." ) sys.exit(1)