Files
api/pyproject.toml
T
Flea Flicker 8c78fde48d
CI / lint (pull_request) Failing after 7s
CI / typecheck (pull_request) Failing after 48s
CI / test (pull_request) Failing after 1m35s
CI / build-and-push (pull_request) Has been skipped
Fix SQLite UUID and server_default incompatibilities in test fixtures
Adds SQLiteCompatibleUUID TypeDecorator and _StringUUID fallback to handle
PostgreSQL UUID and Text PK columns when using SQLite test database.

- SQLiteCompatibleUUID: converts uuid.UUID to CHAR(32) hex string for bind,
  returns uuid.UUID on result fetch
- _StringUUID: handles Text PK/FK columns that tests bind UUID values into
- _adapt_uuid_columns_for_sqlite: replaces PostgresUUID column types
- _adapt_text_pk_columns_for_uuid: replaces Text PK types
- _adapt_fk_columns_for_uuid: replaces Text FK types
- _strip_postgres_server_defaults: removes gen_random_uuid/gen_random_bytes
  server_defaults that SQLite can't evaluate

Updates test_encrypted_json.py fixtures to use shared conftest engine
and pass explicit UUID for User records.

Fixes CAR-1111.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-01 11:37:05 +00:00

64 lines
1.4 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "cartsnitch-api"
version = "0.1.0"
description = "CartSnitch API Gateway — public-facing REST API"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.30.0",
"pydantic[email]>=2.9.0",
"pydantic-settings>=2.5.0",
"sqlalchemy[asyncio]>=2.0.35",
"asyncpg>=0.30.0",
"alembic>=1.13,<2.0",
"psycopg2-binary>=2.9,<3.0",
"python-jose[cryptography]>=3.3.0",
"passlib[bcrypt]>=1.7.4",
"httpx>=0.27.0",
"redis[hiredis]>=5.2.0",
"cryptography>=43.0.0",
"pytest[dev]>=9.0.3",
"pytest-asyncio[dev]>=1.3.0",
"aiosqlite[dev]>=0.22.1",
"ruff[dev]>=0.15.14",
"mypy[dev]>=1.19.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.3.0",
"pytest-asyncio>=0.24.0",
"aiosqlite>=0.20.0",
"httpx>=0.27.0",
"ruff>=0.7.0",
"psycopg2-binary>=2.9,<3.0",
]
[tool.hatch.build.targets.wheel]
packages = ["src/cartsnitch_api"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "I", "N", "UP", "B"]
[tool.ruff.lint.per-file-ignores]
"src/cartsnitch_api/**/routes*.py" = ["B008"]
"src/cartsnitch_api/**/dependencies.py" = ["B008"]
[tool.mypy]
python_version = "3.12"
ignore_missing_imports = true
warn_return_any = true
warn_unused_configs = true