undo: keep poetry-uv change limited to CI/CD fo now

This commit is contained in:
Daulet Amirkhanov 2025-08-15 09:45:25 +01:00
parent 3941e469e5
commit 4312508cf3
6 changed files with 26 additions and 18 deletions

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

View file

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

View file

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

View file

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

View file

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

View file

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