Update installation instructions and replace Poetry with uv across documentation and scripts

This commit is contained in:
Daulet Amirkhanov 2025-08-14 15:16:03 +01:00
parent c60627306f
commit cb5590b655
7 changed files with 20 additions and 28 deletions

View file

@ -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

View file

@ -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

View file

@ -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`

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)