From 25ae301506acc4c206be3d22a180ff35d08d98a4 Mon Sep 17 00:00:00 2001 From: OctaveLauby Date: Thu, 4 Jun 2026 14:39:26 +0200 Subject: [PATCH] doc: rm unnecessary documentation --- apps/olapi/README.md | 27 --------------------------- apps/olapi/auth.py | 4 ++-- apps/olapi/dtos/auth.py | 3 +-- apps/olapi/pyproject.toml | 19 ------------------- apps/olapi/routers/auth.py | 2 +- apps/olapi/scripts/request_api.py | 2 +- apps/olapi/tests/test_temporary.py | 2 +- docker/Dockerfile | 1 - libs/authentication/README.md | 24 ------------------------ libs/authentication/pyproject.toml | 1 - pyproject.toml | 11 +---------- 11 files changed, 7 insertions(+), 89 deletions(-) delete mode 100644 apps/olapi/README.md delete mode 100644 libs/authentication/README.md diff --git a/apps/olapi/README.md b/apps/olapi/README.md deleted file mode 100644 index 089be47..0000000 --- a/apps/olapi/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# olapi - -The Social Media API application (FastAPI). - -This is a flat [uv-app](https://docs.astral.sh/uv/concepts/projects/init/#applications): -modules live directly under this directory and are imported relative to it (e.g. -`from main import app`). The app is not packaged or installed. - -## Run - -From the repository root: - -```bash -make run # docker compose up (postgres + keycloak + api) -``` - -Or directly with uvicorn from this directory: - -```bash -uv run uvicorn main:app --reload -``` - -## Test - -```bash -uv run --directory apps/olapi pytest -``` diff --git a/apps/olapi/auth.py b/apps/olapi/auth.py index 70b4d0b..7546c0c 100644 --- a/apps/olapi/auth.py +++ b/apps/olapi/auth.py @@ -1,11 +1,11 @@ +from authentication import exceptions as auth_exceptions +from authentication.keycloak import KeycloakClient from fastapi import Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer from sqlalchemy import select from sqlalchemy.exc import NoResultFound from sqlalchemy.orm import Session -from authentication import exceptions as auth_exceptions -from authentication.keycloak import KeycloakClient from database import get_session from models.user import UserModel from settings import settings diff --git a/apps/olapi/dtos/auth.py b/apps/olapi/dtos/auth.py index 56a56c8..6f286aa 100644 --- a/apps/olapi/dtos/auth.py +++ b/apps/olapi/dtos/auth.py @@ -1,8 +1,7 @@ from typing import Self -from pydantic import BaseModel, EmailStr - from authentication.keycloak import TokenInfo +from pydantic import BaseModel, EmailStr class Credentials(BaseModel): diff --git a/apps/olapi/pyproject.toml b/apps/olapi/pyproject.toml index ff8f301..3fe36b2 100644 --- a/apps/olapi/pyproject.toml +++ b/apps/olapi/pyproject.toml @@ -2,7 +2,6 @@ name = "olapi" version = "0.0.1" description = "Social Media API" -readme = "README.md" requires-python = ">=3.12" dependencies = [ "fastapi>=0.110", @@ -16,9 +15,6 @@ dependencies = [ "authentication", ] -# Flat uv-app: no [build-system], so the app is not built or installed as a -# package. Its modules are imported relative to this directory (see pythonpath). - [tool.uv.sources] authentication = { workspace = true } @@ -27,18 +23,3 @@ pythonpath = ["."] [tool.ruff] extend = "../../pyproject.toml" - -# The app is flat, so isort can't auto-detect its own modules; the authentication -# workspace library is also a first-party concern. Group them together. -[tool.ruff.lint.isort] -known-first-party = [ - "authentication", - "auth", - "conftest", - "database", - "dtos", - "main", - "models", - "routers", - "settings", -] diff --git a/apps/olapi/routers/auth.py b/apps/olapi/routers/auth.py index ab3e904..2405fa5 100644 --- a/apps/olapi/routers/auth.py +++ b/apps/olapi/routers/auth.py @@ -1,5 +1,6 @@ import logging +from authentication import exceptions as auth_exceptions from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy import select from sqlalchemy.exc import NoResultFound, SQLAlchemyError @@ -7,7 +8,6 @@ from ulid import ULID from auth import auth_client -from authentication import exceptions as auth_exceptions from database import get_session from dtos.auth import Credentials, TokenResponse from dtos.user import User, UserCreatePayload diff --git a/apps/olapi/scripts/request_api.py b/apps/olapi/scripts/request_api.py index 14ff0c1..122eb04 100644 --- a/apps/olapi/scripts/request_api.py +++ b/apps/olapi/scripts/request_api.py @@ -1,8 +1,8 @@ import logging import httpx2 - from authentication.keycloak import check_response + from dtos.auth import Credentials, TokenResponse from dtos.user import User, UserCreatePayload diff --git a/apps/olapi/tests/test_temporary.py b/apps/olapi/tests/test_temporary.py index 339aa49..dd21c14 100644 --- a/apps/olapi/tests/test_temporary.py +++ b/apps/olapi/tests/test_temporary.py @@ -1,7 +1,7 @@ +from conftest import TEST_AUTH_ID from fastapi.testclient import TestClient from sqlalchemy.orm import Session -from conftest import TEST_AUTH_ID from models.user import UserModel diff --git a/docker/Dockerfile b/docker/Dockerfile index 3e29c75..c2e664a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,7 +11,6 @@ RUN uv sync --frozen --no-dev ENV PATH="/app/.venv/bin:$PATH" -# The olapi app is a flat uv-app; run it from its own directory so `main:app` resolves. WORKDIR /app/apps/olapi EXPOSE 8000 diff --git a/libs/authentication/README.md b/libs/authentication/README.md deleted file mode 100644 index 89c8b07..0000000 --- a/libs/authentication/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# authentication - -Keycloak authentication client library (src-layout, packaged with `uv_build`). - -Exposes a `KeycloakClient` and related exceptions used by workspace apps to -register users, issue tokens, and validate them. - -## Use - -Declare it as a workspace dependency in a member's `pyproject.toml`: - -```toml -dependencies = ["authentication"] - -[tool.uv.sources] -authentication = { workspace = true } -``` - -Then import: - -```python -from authentication.keycloak import KeycloakClient -from authentication import exceptions -``` diff --git a/libs/authentication/pyproject.toml b/libs/authentication/pyproject.toml index 13bbbc9..ee7681c 100644 --- a/libs/authentication/pyproject.toml +++ b/libs/authentication/pyproject.toml @@ -2,7 +2,6 @@ name = "authentication" version = "0.0.1" description = "Keycloak authentication client" -readme = "README.md" requires-python = ">=3.12" dependencies = [ "httpx2>=2.3", diff --git a/pyproject.toml b/pyproject.toml index 65de0db..613ccfa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,15 +10,9 @@ dev = [ ] [tool.pytest.ini_options] -# Libraries are collected here; apps run in their own pytest process (see the -# Makefile) so the flat app modules don't collide with library test discovery. testpaths = ["libs"] -# importlib import mode imports each test file under a unique name, so -# identically-named test files across members can coexist without __init__.py. -addopts = ["--import-mode=importlib"] +addopts = ["--import-mode=importlib"] # avoid test name conflict between libraries -# Shared lint config for the whole workspace. Members extend this via -# `[tool.ruff] extend = "../../pyproject.toml"`. [tool.ruff] target-version = "py312" line-length = 100 @@ -45,8 +39,5 @@ venvPath = "." venv = ".venv" include = ["apps", "libs"] -# The olapi app is a flat, non-packaged uv-app: its modules live directly under -# apps/olapi and are imported as `from main import ...`. This execution -# environment puts that directory on the import path for the type checker. [[tool.pyright.executionEnvironments]] root = "apps/olapi"