Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions apps/olapi/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions apps/olapi/auth.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions apps/olapi/dtos/auth.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
19 changes: 0 additions & 19 deletions apps/olapi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 }

Expand All @@ -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",
]
2 changes: 1 addition & 1 deletion apps/olapi/routers/auth.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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
from sqlalchemy.orm import Session
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
Expand Down
2 changes: 1 addition & 1 deletion apps/olapi/scripts/request_api.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion apps/olapi/tests/test_temporary.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
1 change: 0 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions libs/authentication/README.md

This file was deleted.

1 change: 0 additions & 1 deletion libs/authentication/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 1 addition & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Loading