Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid get on PackageMetadata in FastAPI template #163

Merged
merged 1 commit into from May 2, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 } }