From cb5590b655677311b6c64af8b8fc4f5999d711b8 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 14 Aug 2025 15:16:03 +0100 Subject: [PATCH] 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)