Skip to content

Commit

Permalink
Merge pull request #163 from lsst/u/rra/upgrades
Browse files Browse the repository at this point in the history
Avoid get on PackageMetadata in FastAPI template
  • Loading branch information
rra committed May 2, 2022
2 parents 7108973 + b5fe909 commit 887b386
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Expand Up @@ -7,7 +7,7 @@
called.
"""

from importlib.metadata import metadata
from importlib.metadata import metadata, version

from fastapi import FastAPI
from safir.dependencies.http_client import http_client_dependency
Expand All @@ -29,8 +29,8 @@

app = FastAPI(
title="example",
description=metadata("example").get("Summary", ""),
version=metadata("example").get("Version", "0.0.0"),
description=metadata("example")["Summary"],
version=version("example"),
openapi_url=f"/{config.name}/openapi.json",
docs_url=f"/{config.name}/docs",
redoc_url=f"/{config.name}/redoc",
Expand Down
Expand Up @@ -7,7 +7,7 @@
called.
"""

from importlib.metadata import metadata
from importlib.metadata import metadata, version

from fastapi import FastAPI
from safir.dependencies.http_client import http_client_dependency
Expand All @@ -29,8 +29,8 @@

app = FastAPI(
title="{{ cookiecutter.name }}",
description=metadata("{{ cookiecutter.name }}").get("Summary", ""),
version=metadata("{{ cookiecutter.name }}").get("Version", "0.0.0"),
description=metadata("{{ cookiecutter.name }}")["Summary"],
version=version("{{ cookiecutter.name }}"),
openapi_url=f"/{config.name}/openapi.json",
docs_url=f"/{config.name}/docs",
redoc_url=f"/{config.name}/redoc",
Expand Down
2 changes: 1 addition & 1 deletion project_templates/latex_lsstdoc/EXAMPLE-0/bibentry.txt
Expand Up @@ -4,6 +4,6 @@
author = { First Author },
title = {Document Title},
year = 2022,
month = Apr,
month = May,
handle = {EXAMPLE-0},
url = {https://example-0-0.lsst.io } }
2 changes: 1 addition & 1 deletion project_templates/latex_lsstdoc/EXAMPLE/bibentry.txt
Expand Up @@ -4,6 +4,6 @@
author = { First Author },
title = {Document Title},
year = 2022,
month = Apr,
month = May,
handle = {EXAMPLE},
url = {https://example-.lsst.io } }
2 changes: 1 addition & 1 deletion project_templates/technote_latex/testn-000/bibentry.txt
Expand Up @@ -4,6 +4,6 @@
author = { First Last },
title = {Document Title},
year = 2022,
month = Apr,
month = May,
handle = {TESTN-000},
url = {https://testn-000.lsst.io } }
2 changes: 1 addition & 1 deletion project_templates/technote_rst/testn-000/bibentry.txt
Expand Up @@ -4,6 +4,6 @@
author = { First Last },
title = {Document Title},
year = 2022,
month = Apr,
month = May,
handle = {TESTN-000},
url = {https://testn-000.lsst.io } }
2 changes: 1 addition & 1 deletion project_templates/test_report/TESTTR-0/bibentry.txt
Expand Up @@ -4,6 +4,6 @@
author = { First Author },
title = {Document Title},
year = 2022,
month = Apr,
month = May,
handle = {TESTTR-0},
url = {https://testtr-0.lsst.io } }

0 comments on commit 887b386

Please sign in to comment.