Skip to content

Commit

Permalink
fix: Fix documentation in production (#201) (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Nov 13, 2023
1 parent fe56f4a commit 6973d0e
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 5 deletions.
7 changes: 6 additions & 1 deletion backend/app/api/api_v1/endpoints/adminmsgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ async def read_adminmsgs(
skip: int = 0,
limit: int = 100,
) -> list[schemas.AdminMessageRead]:
"""Retrieve all admin messages"""
"""
Retrieve all admin messages.
:return: list of admin messages
:rtype: list
"""
users = [
schemas.AdminMessageRead.model_validate(db_obj)
for db_obj in await crud.adminmessage.get_multi(db, skip=skip, limit=limit)
Expand Down
7 changes: 6 additions & 1 deletion backend/app/api/api_v1/endpoints/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

@router.get("/oauth2-providers", response_model=list[schemas.OAuth2ProviderPublic])
async def list_oauth2_providers() -> list[schemas.OAuth2ProviderPublic]:
"""Retrieve all admin messages"""
"""
Retrieve all admin messages.
:return: list of admin messages
:rtype: list
"""
providers = [
schemas.OAuth2ProviderPublic.model_validate(obj.model_dump())
for obj in config.settings.OAUTH2_PROVIDERS
Expand Down
6 changes: 6 additions & 0 deletions backend/app/api/api_v1/endpoints/caseinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async def create_caseinfo(
:param caseinfo: Case Information to create
:type caseinfo: dict or :class:`.schemas.CaseInfoCreate`
:return: Case Information
:rtype: dict
"""
caseinfo.user = user.id
return await crud.caseinfo.create(db, obj_in=caseinfo)
Expand Down Expand Up @@ -57,6 +58,7 @@ async def get_caseinfo(id: str, db: AsyncSession = Depends(deps.get_db)):
:param id: Case Information id
:type id: uuid
:return: Case Information
:rtype: dict
"""
response = await crud.caseinfo.get(db, id=id)
if not response:
Expand All @@ -77,6 +79,7 @@ async def delete_caseinfo(id: str, db: AsyncSession = Depends(deps.get_db)):
:param id: Case Information id
:type id: uuid
:return: Case Information
:rtype: dict
"""
response = await crud.caseinfo.remove(db, id=id)
if not response:
Expand Down Expand Up @@ -107,6 +110,7 @@ async def get_caseinfo_for_user(
Get a Case Information for a current user.
:return: Case Information
:rtype: dict
"""
caseinfo = await crud.caseinfo.get_by_user(db, user_id=user.id)
if not caseinfo:
Expand All @@ -127,6 +131,7 @@ async def update_caseinfo_for_user(
:param caseinfo: Case Information to update
:type caseinfo: dict or :class:`.schemas.CaseInfoUpdate`
:return: Case Information
:rtype: dict
"""
caseinfoupdate.user = user.id
caseinfo = await crud.caseinfo.get_by_user(db, user_id=user.id)
Expand All @@ -143,6 +148,7 @@ async def delete_caseinfo_for_user(
Delete a Case Information for a current user.
:return: Case Information
:rtype: dict
"""
caseinfo = await crud.caseinfo.get_by_user(db, user_id=user.id)
if not caseinfo:
Expand Down
9 changes: 8 additions & 1 deletion backend/app/api/api_v1/endpoints/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
dependencies=[Depends(current_active_superuser)],
)
def test_email(email_to: EmailStr) -> Any:
"""Send out a test email."""
"""
Send out a test email.
:param email_to: email address to send the test email to
:type email_to: str
:return: message
:rtype: dict
"""
send_test_email(email_to=email_to)
return {"msg": "Test email sent"}
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Setting up backend for documentation-------------------------------------

import os
import sys

sys.path.insert(0, os.path.abspath("../backend"))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand Down
99 changes: 97 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,97 @@
sphinx
sphinx-rtd-theme
aiosqlite==0.19.0
alabaster==0.7.13
alembic==1.12.1
annotated-types==0.6.0
anyio==3.7.1
async-timeout==4.0.3
asyncpg==0.29.0
Babel==2.13.1
bcrypt==4.0.1
black==23.10.1
cachetools==5.3.2
certifi==2023.7.22
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
coverage==7.3.2
cryptography==41.0.5
cssselect==1.2.0
cssutils==2.9.0
dnspython==2.4.2
docutils==0.18.1
email-validator==2.0.0.post2
emails==0.6
exceptiongroup==1.1.3
Faker==19.13.0
fastapi==0.104.1
fastapi-users==12.1.2
fastapi-users-db-sqlalchemy==6.0.1
flake8==6.1.0
greenlet==3.0.1
h11==0.14.0
httpcore==0.17.3
httpx
httpx-oauth
idna==3.4
imagesize==1.4.1
iniconfig==2.0.0
install==1.3.5
isort==5.12.0
Jinja2==3.1.2
lxml==4.9.3
makefun==1.15.2
Mako==1.3.0
MarkupSafe==2.1.3
mccabe==0.7.0
mypy==1.6.1
mypy-extensions==1.0.0
packaging==23.2
passlib==1.7.4
pathspec==0.11.2
platformdirs==3.11.0
pluggy==1.3.0
premailer==3.10.0
psycopg2-binary==2.9.9
pycodestyle==2.11.1
pycparser==2.21
pydantic==2.4.2
pydantic-settings==2.0.3
pydantic_core==2.10.1
pyflakes==3.1.0
Pygments==2.16.1
PyJWT==2.8.0
pytest==7.4.3
pytest-asyncio==0.21.1
pytest-cov==4.1.0
pytest-faker==2.0.0
pytest-httpx
pytest-subprocess==1.5.0
python-dateutil==2.8.2
python-dotenv==1.0.0
python-multipart==0.0.6
redis==5.0.1
requests==2.31.0
requests-mock==1.11.0
six==1.16.0
sniffio==1.3.0
snowballstemmer==2.2.0
Sphinx==7.2.6
sphinx-rtd-theme==1.3.0
sphinx-serve==1.0.1
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
SQLAlchemy==2.0.23
starlette==0.27.0
tenacity==8.2.3
tomli==2.0.1
types-passlib==1.7.7.13
types-requests==2.31.0.10
typing_extensions==4.8.0
urllib3==2.1.0
uvicorn==0.24.0.post1

0 comments on commit 6973d0e

Please sign in to comment.