From fb5d502b185ef3c0cb528a741367be86cf0c8d4d Mon Sep 17 00:00:00 2001 From: Loic Huder Date: Mon, 11 Sep 2023 15:56:37 +0200 Subject: [PATCH 1/2] Fix broken import of BaseSettings for pydantic v2 --- h5grove/fastapi_utils.py | 2 +- setup.cfg | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/h5grove/fastapi_utils.py b/h5grove/fastapi_utils.py index e680638..e64c7b8 100644 --- a/h5grove/fastapi_utils.py +++ b/h5grove/fastapi_utils.py @@ -1,7 +1,7 @@ """Helpers for usage with `FastAPI `_""" from fastapi import APIRouter, Depends, Response, Query, Request from fastapi.routing import APIRoute -from pydantic import BaseSettings +from pydantic_settings import BaseSettings from typing import List, Optional, Union, Callable from .content import ( diff --git a/setup.cfg b/setup.cfg index 51a7fa8..451e86c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,6 +27,8 @@ install_requires = [options.extras_require] fastapi = fastapi + pydantic > 2 + pydantic-settings uvicorn flask = Flask From 4f29f86d92bb9c4b5c14ec993ebc3c0e8f426bd4 Mon Sep 17 00:00:00 2001 From: Loic Huder Date: Mon, 11 Sep 2023 16:00:42 +0200 Subject: [PATCH 2/2] Increase sleeping time before test server starts --- test/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/conftest.py b/test/conftest.py index bbbda05..ce6c6dd 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -111,7 +111,7 @@ def subprocess_server(tmp_path_factory, request): env = os.environ.copy() env["PYTHONPATH"] = f"{str(project_root_dir)}:{env.get('PYTHONPATH', '')}" process = subprocess.Popen(cmd, env=env) - time.sleep(1) + time.sleep(5) assert process.poll() is None # Check that server is running yield SubprocessServer(served_dir=base_dir, base_url=f"http://{host}:{port}")