contiai / apps /api /pyproject.toml
aliabozahra315's picture
Deploy 144604f: PDF contents links
411be0e
Raw History Blame Contribute Delete
5.07 kB
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
# Named, not discovered. setuptools looks at the directory when nothing says
# otherwise, finds `app` and `alembic` side by side, and refuses rather than
# guess which one is the distribution:
#
# error: Multiple top-level packages discovered in a flat-layout:
# ['app', 'alembic']
#
# It never surfaced locally because the virtualenv was installed before
# `alembic/` existed and pip has not resolved it since. The first clean
# install - CI - stopped in nine seconds.
[tool.setuptools.packages.find]
include = ["app*"]
[project]
name = "contiai-api"
version = "1.0.0"
description = "ContiAI platform API - pipeline engine, agents, cost metering"
requires-python = ">=3.11,<3.12"
# Every one of these is pinned, and that is the point rather than a style.
#
# Twenty of the forty-two were loose, so a clean install resolved them afresh
# every time and the build broke on days when nothing here had changed:
# mistralai moved and `from mistralai import Mistral` stopped existing.
# A dependency without a version is a dependency nobody has tested.
#
# To move one: change it here, install it, run the suite, commit all three.
dependencies = [
# web
"fastapi==0.140.0",
"uvicorn[standard]==0.51.0",
"gunicorn==23.0.0",
"python-multipart==0.0.32",
"sse-starlette==3.4.6",
# data
"sqlalchemy[asyncio]==2.0.51",
"asyncpg==0.30.0",
# The application talks to Postgres through asyncpg; Alembic does not.
# `alembic/env.py` strips `+asyncpg` from the URL and connects synchronously,
# so without a sync driver `alembic upgrade head` fails at boot - which on
# Render is the first command the API runs, before it ever serves a request.
"psycopg2-binary==2.9.10",
"alembic==1.18.5",
"pydantic==2.12.4",
# 2.14.2, not 2.7.1. The pin was left behind when CrewAI was upgraded:
# crewai 1.15.7 requires pydantic-settings>=2.14.2, and pip resolved the
# conflict silently in the existing virtualenv while refusing outright on a
# clean install - so the build failed on the first container and nowhere
# else. This is the version that is installed and tested against.
"pydantic-settings==2.14.2",
"pydantic[email]==2.12.4",
# queue
"arq==0.26.3",
"redis==5.3.1",
# auth
"pyjwt[crypto]==2.13.0",
# agents - pinned. litellm >=1.92 ships a Rust extension with no win_amd64
# wheel, so anything above that breaks local development on Windows.
"crewai[tools]==1.15.7",
"litellm==1.91.4",
"langchain==1.3.14",
"langchain-core==1.5.1",
"langchain-community==0.4.2",
"langchain_openai==1.4.1",
"langchain-openrouter==0.2.7",
"openai==2.49.0",
"mistralai==1.12.4",
# rag
"sentence-transformers==5.6.1",
# Matched to the server, not held below it. Qdrant Cloud runs 1.19 and the
# client refuses more than one minor version of drift - it warns on every
# single call, and the wire format is where a silent break would land.
"qdrant-client==1.19.0",
"pymupdf==1.26.7",
"rapidfuzz==3.14.5",
# scraping
"crawlee==0.3.6",
"browserforge==1.1.2",
"parsel==1.11.0",
"apify-fingerprint-datapoints==0.13.0",
# docs
"PyPDF2==3.0.1",
# PyPDF2's successor: clones a whole PDF, links and all, to lay a link over
# the designed bag's header house (arabic_bag/design/navigation.link_home)
"pypdf==5.4.0",
"reportlab==5.0.0",
"markdown==3.10.2",
# Both renderers were relying on python-docx arriving transitively through
# crewai's extras. Every Word export in the product depends on it, so it is
# named here rather than left to a dependency that could drop it.
"python-docx==1.2.0",
# The designed bag: the fixed images are SVG coloured per bag and rasterised
# with resvg; logo colours are read with Pillow.
"resvg-py==0.5.0",
"pillow==12.3.0",
"python-pptx==1.0.2",
# The designed book: HTML laid out for print (CSS paged media) and written
# to PDF. Needs Pango on the system (see the Dockerfile).
"weasyprint==70.0",
# misc
"supabase==2.31.0",
"apscheduler==3.11.3",
"pycryptodome==3.23.0",
"httpx==0.28.1",
"python-dotenv==1.2.2",
]
[project.optional-dependencies]
dev = [
"pytest==8.4.2",
"pytest-asyncio==1.3.0",
"ruff==0.14.6",
"aiosqlite",
]
[tool.ruff]
line-length = 100
target-version = "py311"
# The ported agent packages are carried over verbatim so the prompts stay
# byte-identical to what is running in production. They are not restyled.
exclude = ["app/agents", "app/rag", "app/schemas", "app/tools", "app/services", "app/llm"]
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
ignore = ["B008"]
[tool.ruff.lint.per-file-ignores]
# Importing a pytest fixture is how it is shared between test modules, and it
# then appears again as the parameter that receives it. That is the mechanism,
# not a redefinition.
"tests/*" = ["F811"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
filterwarnings = ["ignore::DeprecationWarning"]
markers = ["real_fitter: runs the length fitter against a stubbed model"]