Skip to content

Commit

Permalink
chore: update bento_lib to 10.1.0 and move service name to config
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Nov 21, 2023
1 parent fd86297 commit 358afe3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion bento_drop_box_service/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json

from bento_lib.logging import LogLevelLiteral
from fastapi import Depends
from functools import lru_cache
from pydantic.fields import FieldInfo
Expand Down Expand Up @@ -27,6 +28,7 @@ class Config(BaseSettings):
bento_container_local: bool = False

service_id: str = str(":".join(list(SERVICE_TYPE.values())[:2]))
service_name: str = "Bento Drop Box Service"
service_data_source: Literal["local"] = "local"
service_data: str = "data/"
service_url: str = "http://127.0.0.1:5000" # base URL to construct object URIs from
Expand All @@ -38,7 +40,7 @@ class Config(BaseSettings):

cors_origins: tuple[str, ...]

log_level: Literal["debug", "info", "warning", "error"] = "debug"
log_level: LogLevelLiteral = "debug"

# Make Config instances hashable + immutable
model_config = SettingsConfigDict(frozen=True)
Expand Down
2 changes: 0 additions & 2 deletions bento_drop_box_service/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

__all__ = [
"BENTO_SERVICE_KIND",
"SERVICE_NAME",
"SERVICE_TYPE",
]

BENTO_SERVICE_KIND = "drop-box"
SERVICE_NAME = "Bento Drop Box Service"
SERVICE_TYPE: GA4GHServiceType = {
"group": "ca.c3g.bento",
"artifact": BENTO_SERVICE_KIND,
Expand Down
4 changes: 2 additions & 2 deletions bento_drop_box_service/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from . import __version__
from .authz import authz_middleware
from .backends.dependency import BackendDependency
from .constants import BENTO_SERVICE_KIND, SERVICE_NAME, SERVICE_TYPE
from .constants import BENTO_SERVICE_KIND, SERVICE_TYPE
from .config import ConfigDependency
from .logger import LoggerDependency

Expand Down Expand Up @@ -76,7 +76,7 @@ async def service_info(config: ConfigDependency, logger: LoggerDependency) -> Re
# Spec: https://github.com/ga4gh-discovery/ga4gh-service-info
return JSONResponse(await build_service_info({
"id": config.service_id,
"name": SERVICE_NAME,
"name": config.service_name,
"type": SERVICE_TYPE,
"description": "Drop box service for a Bento platform node.",
"organization": SERVICE_ORGANIZATION_C3G,
Expand Down
9 changes: 5 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [

[tool.poetry.dependencies]
python = "^3.10.0"
bento-lib = {extras = ["fastapi"], version = "^10.0.0"}
bento-lib = {extras = ["fastapi"], version = "^10.1.0"}
aiofiles = "^23.1.0"
fastapi = "^0.104.0"
werkzeug = "^3.0.1"
Expand Down

0 comments on commit 358afe3

Please sign in to comment.