chore: migrate package manager to uv

This commit is contained in:
swve 2024-11-18 21:11:12 +01:00
parent 421cc82637
commit 74e389f4bc
7 changed files with 2265 additions and 4307 deletions

View file

@ -1,6 +1,8 @@
name: API Lint
on:
push:
branches:
- dev
paths:
- "apps/api/**"
pull_request:

View file

@ -1,6 +1,8 @@
name: Web Lint
on:
push:
branches:
- dev
paths:
- "apps/web/**"
pull_request:

View file

@ -39,12 +39,11 @@ COPY --from=deps --chown=app:system /app/web/.next/static ./app/web/.next/static
# Backend Build
WORKDIR /app/api
COPY ./apps/api/poetry.lock* ./
COPY ./apps/api/uv.lock ./
COPY ./apps/api/pyproject.toml ./
RUN pip install --upgrade pip \
&& pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
&& pip install uv \
&& uv sync
COPY ./apps/api ./
# Run the backend

View file

@ -15,14 +15,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir poetry \
&& poetry config virtualenvs.create false
&& pip install --no-cache-dir uv
# Copy only requirements to cache them in docker layer
COPY poetry.lock pyproject.toml ./
COPY uv.lock pyproject.toml ./
# Install dependencies
RUN poetry install --no-interaction --no-ansi --no-root --only main
# Install dependencies using uv
RUN uv sync
# Copy the current directory contents into the container
COPY . .

4254
apps/api/poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,48 +1,44 @@
[tool.ruff]
lint.ignore = ["E501", "E712"]
[tool.poetry]
authors = ["Badr B. (swve)"]
[project]
description = "Learnhouse Backend"
name = "learnhouse-api"
package-mode = false
readme = "README.md"
version = "0.1.0"
requires-python = ">=3.12.3,<3.13.0"
authors = [
{name = "Badr B. (swve)"}
]
dependencies = [
"boto3>=1.34.79",
"botocore>=1.34.93",
"faker>=30.1.0",
"fastapi>=0.115.0",
"fastapi-jwt-auth>=0.5.0",
"httpx>=0.27.0",
"langchain>=0.2.0",
"langchain-community>=0.2.0",
"langchain-openai>=0.1.7",
"openai>=1.50.2",
"passlib>=1.7.4",
"psycopg2-binary>=2.9.9",
"pydantic[email]>=1.8.0,<2.0.0",
"pytest>=8.2.2",
"python-dotenv>=1.0.0",
"python-multipart>=0.0.9",
"pyyaml>=6.0.1",
"redis>=5.0.7",
"requests>=2.32.3",
"resend>=2.4.0",
"sentry-sdk[fastapi]>=2.13.0",
"sqlmodel>=0.0.19",
"tiktoken>=0.7.0",
"uvicorn==0.30.1",
"typer>=0.12.5",
"chromadb==0.5.16",
"alembic>=1.13.2",
"alembic-postgresql-enum>=1.2.0",
"sqlalchemy-utils>=0.41.2",
"stripe>=11.1.1",
"python-jose>=3.3.0",
]
[tool.poetry.dependencies]
boto3 = "^1.34.79"
botocore = "^1.34.93"
faker = "^30.1.0"
fastapi = "^0.115.0"
fastapi-jwt-auth = "^0.5.0"
httpx = "^0.27.0"
langchain = "^0.2.0"
langchain-community = "^0.2.0"
langchain-openai = "^0.1.7"
openai = "^1.50.2"
passlib = "^1.7.4"
psycopg2-binary = "^2.9.9"
pydantic = {version = ">=1.8.0,<2.0.0", extras = ["email"]}
pytest = "^8.2.2"
python = "^3.12"
python-dotenv = "^1.0.0"
python-jose = "^3.3.0"
python-multipart = "^0.0.9"
pyyaml = "^6.0.1"
redis = "^5.0.7"
requests = "^2.32.3"
resend = "^2.4.0"
sentry-sdk = {extras = ["fastapi"], version = "^2.13.0"}
sqlmodel = "^0.0.19"
tiktoken = "^0.7.0"
uvicorn = "0.30.1"
typer = "^0.12.5"
chromadb = "0.5.16"
alembic = "^1.13.2"
alembic-postgresql-enum = "^1.2.0"
sqlalchemy-utils = "^0.41.2"
stripe = "^11.1.1"
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[tool.ruff]
lint.ignore = ["E501", "E712"]

2214
apps/api/uv.lock generated Normal file

File diff suppressed because it is too large Load diff