Skip to content

Commit ce81e02

Browse files
Add missed files
1 parent 2f6700a commit ce81e02

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ name = "Oliver Silvester"
5757
[tool.setuptools_scm]
5858
version_file = "src/daq_config_server/_version.py"
5959

60-
[tool.pyright]
61-
typeCheckingMode = "strict"
62-
reportMissingImports = false # Ignore missing stubs in imported modules
63-
6460
[tool.pytest.ini_options]
6561
asyncio_mode = "auto"
6662
asyncio_default_fixture_loop_scope = "function"

pyrightconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"typeCheckingMode": "strict",
3+
"reportMissingImports": false,
4+
"reportPrivateUsage": true,
5+
"executionEnvironments": [
6+
{
7+
"root": "./tests",
8+
"reportPrivateUsage": false
9+
}
10+
],
11+
"reportMissingTypeStubs": false,
12+
"extraPaths": ["."]
13+
}

src/daq_config_server/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def get_configuration(
5959
with file_path.open("r", encoding="utf-8") as f:
6060
content = f.read()
6161
return Response(content=content, media_type=accept)
62+
case _:
63+
pass
6264
except Exception as e:
6365
LOGGER.warning(
6466
f"Failed to convert {file_name} to {accept} and caught \

src/daq_config_server/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(
3737
"""
3838
self._url = url.rstrip("/")
3939
self._log = log if log else getLogger("daq_config_server.client")
40-
self._cache: TTLCache[tuple[str, str | None], str] = TTLCache(
40+
self._cache: TTLCache[tuple[str, str, str], str] = TTLCache(
4141
maxsize=cache_size, ttl=cache_lifetime_s
4242
)
4343

@@ -75,7 +75,7 @@ def _get(
7575
endpoint: str,
7676
accept_header: str,
7777
item: str,
78-
reset_cached_result=False,
78+
reset_cached_result: bool = False,
7979
):
8080
"""
8181
Get data from the config server with cache management and use

tests/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from pathlib import Path
22

3-
TEST_DATA_DIR = Path(f"{Path(__file__).parent}/test_data")
3+
TEST_DATA_DIR: Path = Path(f"{Path(__file__).parent}/test_data")

tests/unit_tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def _assert_get_and_response(
2424
client: TestClient,
2525
endpoint: str,
2626
expected_response: Any,
27-
header: dict = HEADER_DEFAULTS,
27+
header: dict[str, ValidAcceptHeaders] = HEADER_DEFAULTS,
2828
):
2929
response = client.get(endpoint, headers=header)
3030
assert response.status_code == status.HTTP_200_OK

0 commit comments

Comments
 (0)