Skip to content

Commit b29b517

Browse files
committed
Update fastapi, fastapimsal, mypy, etc
1 parent c983ec6 commit b29b517

37 files changed

+88
-61
lines changed

alembic/versions/b65796c99771_squash.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2023-07-06 22:17:36.160486
66
77
"""
8+
89
import sqlalchemy as sa
910
from sqlalchemy import text
1011
from sqlalchemy.dialects import postgresql

docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Configuration file for the Sphinx documentation builder."""
2+
23
import os
34
from importlib import metadata
45
from unittest.mock import patch

poetry.lock

+51-56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ alembic = "^1.7.1"
1010
asyncpg = "^0.27.0"
1111
azure-identity = "^1.16.0"
1212
databases = { version = "^0.6.2", extras = ["postgresql"] }
13-
#fastapi = "^0.110.1"
14-
fastapi = "^0.95.0"
15-
fastapimsal = { git = "https://github.com/alan-turing-institute/fastapimsal", tag = "0.4.8" }
13+
fastapi = "^0.110.1"
14+
fastapimsal = { git = "https://github.com/alan-turing-institute/fastapimsal", tag = "0.4.9" }
1615
Jinja2 = "^3.1.3"
1716
opencensus-ext-azure = "^1.1.7"
1817
pandas = "^1.1.3"
@@ -42,7 +41,6 @@ httpie = "3.2.1" # upgrade once the 3.2.2 safety issue is resolved
4241
httpie-jwt-auth = "^0.4.0"
4342
ipykernel = "^6.19.4"
4443
isort = "^5.6.4"
45-
mypy = "^0.991"
4644
pre-commit = "^2.14.1"
4745
pylint = "^2.10.2"
4846
pylint-absolute-imports = "^1.0.1"
@@ -56,6 +54,7 @@ safety = "^3.1.0"
5654
sqlalchemy-stubs = "^0.3"
5755
pydocstyle = "^6.3.0"
5856
hypothesis = "^6.82.6"
57+
mypy = "^1.9.0"
5958

6059
[tool.poetry.extras]
6160
docs = ["sphinx-rtd-theme", "sphinxcontrib-napoleon", "myst-parser"]

rctab/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The RCTab FastAPI web app."""
2+
23
from rctab.main import app
34

45
__all__ = ["app"]

rctab/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Constants that don't change often enough to go in Settings."""
2+
23
from importlib import metadata
34

45
ADMIN_OID = "8b8fb95c-e391-43dd-a6f9-1b03574f7c39"

rctab/crud/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The SQLAlchemy models, Pydantic models and database logic."""
2+
23
from rctab.crud import accounting_models, models, schema
34

45
__all__ = [

rctab/crud/accounting_models.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""SQLAlchemy models for the accounting schema."""
2+
23
from databases import Database
34
from sqlalchemy import (
45
Boolean,

rctab/crud/auth.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""User authentication with Active Directory."""
2+
23
from typing import Dict, Optional
34

45
import fastapimsal

rctab/crud/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""SQLAlchemy models for the default schema."""
2+
23
from typing import List, Mapping, Sequence, Tuple
34

45
import asyncpg

rctab/crud/schema.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Pydantic models for the RCTab API."""
2+
23
import datetime
34
from enum import Enum
45
from typing import Dict, List, Optional, Tuple

rctab/crud/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Database utilities and helper functions."""
2+
23
from typing import List
34
from uuid import UUID
45

rctab/debug.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Used as an entrypoint when debugging from an IDE."""
2+
23
import uvicorn
34

45
from rctab.main import app

rctab/logutils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utilities for logging to a central log workspace."""
2+
23
import logging
34
from typing import Optional
45

rctab/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The entrypoint of the FastAPI application."""
2+
23
import logging
34
from pathlib import Path
45
from typing import Any, Callable, Dict, Final

rctab/routers/accounting/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The accounting routes."""
2+
23
from rctab.routers.accounting import (
34
allocations,
45
approvals,

rctab/routers/accounting/abolishment.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Mark subscriptions as "abolished" if they have been inactive for >90 days."""
2+
23
import logging
34
from datetime import datetime, timedelta
45
from typing import List, Optional

rctab/routers/accounting/allocations.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Allocate some approved budget to a subscription."""
2+
23
from typing import Any, List
34

45
from fastapi import Depends, HTTPException

rctab/routers/accounting/approvals.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Set and fetch approvals for subscriptions."""
2+
23
import datetime
34
from datetime import timedelta
45
from typing import Any, List, Optional

rctab/routers/accounting/cost_recovery.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Charge subscriptions' spending to a cost centre."""
2+
23
from datetime import date, timedelta
34
from typing import Any, Dict, List, Optional
45
from uuid import UUID

rctab/routers/accounting/desired_states.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Calculate and disseminate the desired states of subscriptions."""
2+
23
import datetime
34
import logging
45
from typing import Dict, List, Optional

rctab/routers/accounting/finances.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Deciding who to charge for a subscription's spending."""
2+
23
import calendar
34
import datetime
45
from typing import Any, List

rctab/routers/accounting/persistence.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Routes that determine whether a subscription is permanently on."""
2+
23
from typing import Any
34
from uuid import UUID
45

rctab/routers/accounting/routes.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Miscellaneous queries for the accounting schema."""
2+
23
import datetime
34
import uuid
45
from typing import List, Optional, Union

rctab/routers/accounting/send_emails.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tools for sending email notifications to users."""
2+
23
import logging
34
from contextlib import AbstractAsyncContextManager
45
from datetime import date, datetime, timedelta, timezone

rctab/routers/accounting/status.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Receive data from the status function app."""
2+
23
from typing import Dict
34
from uuid import UUID
45

rctab/routers/accounting/subscription.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Create and fetch subscriptions."""
2+
23
from typing import Any, List, Optional
34
from uuid import UUID
45

rctab/routers/accounting/summary_emails.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Background tasks that run daily."""
2+
23
import logging
34
from datetime import datetime
45
from typing import List, Optional

rctab/routers/accounting/usage.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Set and get usage data."""
2+
23
import calendar
34
import datetime
45
import logging

rctab/routers/frontend.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The user-facing web pages."""
2+
23
import datetime
34
import logging
45
from pathlib import Path

rctab/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Global app configuration."""
2+
23
from functools import lru_cache
34
from typing import Any, List, Optional
45
from uuid import UUID

rctab/tasks.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
for the task to run on schedule:
99
`celery -A rctab.tasks beat --loglevel=info`
1010
"""
11+
1112
import asyncio
1213
import logging
1314
from typing import Any, Final

rctab/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utility functions for the RCTab API."""
2+
23
import functools
34
import logging
45
from contextlib import contextmanager

0 commit comments

Comments
 (0)