This commit is contained in:
Andras Schmelczer 2022-05-26 21:49:39 +02:00
parent 73db6a31f6
commit 76cdd7b4c4
5 changed files with 8 additions and 5 deletions

View file

@ -23,7 +23,7 @@ def main() -> None:
module = import_module(file_name) module = import_module(file_name)
if not function_name: if not function_name:
logger.warning(f"Argument function_name not provided, trying to guess it") logger.warning("Argument function_name not provided, trying to guess it")
if not function_name and "app" in module.__dict__: if not function_name and "app" in module.__dict__:
function_name = "app" function_name = "app"

View file

@ -139,7 +139,7 @@ class GreatAI(FastAPI):
return get_swagger_ui_html(openapi_url="openapi.json", title=self.title) return get_swagger_ui_html(openapi_url="openapi.json", title=self.title)
@self.get("/docs/index.html", include_in_schema=False) @self.get("/docs/index.html", include_in_schema=False)
def redirect_to_entrypoint() -> RedirectResponse: def redirect_to_docs() -> RedirectResponse:
return RedirectResponse("/docs") return RedirectResponse("/docs")
if not disable_metrics: if not disable_metrics:

View file

@ -30,7 +30,7 @@ def parallel_map(
) )
if concurrency == 1 or len(values) <= chunk_size: if concurrency == 1 or len(values) <= chunk_size:
logger.warning(f"Running in series, there is no reason for parallelism") logger.warning("Running in series, there is no reason for parallelism")
iterable = values if disable_progress else tqdm(values) iterable = values if disable_progress else tqdm(values)
return [function(v) for v in iterable] return [function(v) for v in iterable]

View file

@ -16,6 +16,6 @@ python3 -m black . --exclude .env --check
yes | python3 -m mypy . --install-types > /dev/null || true yes | python3 -m mypy . --install-types > /dev/null || true
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty . python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty .
python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E402,F821,W503,E722,E203 python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E722,E402,W503,E203
cd - cd -

View file

@ -3,7 +3,7 @@
set -e set -e
echo "Installing dependencies if necessary" echo "Installing dependencies if necessary"
python3 -m pip install --upgrade autoflake isort black[jupyter] mypy python3 -m pip install --upgrade autoflake isort black[jupyter] mypy flake8
echo "Formatting and checking $1" echo "Formatting and checking $1"
@ -21,4 +21,7 @@ python3 -m black . --exclude .env
echo Running mypy echo Running mypy
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --pretty --follow-imports=silent --exclude=external/ --exclude=/build/ . python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --pretty --follow-imports=silent --exclude=external/ --exclude=/build/ .
echo Running Flake8
python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E722,E402,W503,E203
cd - cd -