Skip to content

Commit

Permalink
Add type check for serve.py (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaanagw authored Oct 3, 2024
1 parent 34aa499 commit f4c4966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lightly/api/serve.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from typing import Sequence
Expand All @@ -10,7 +12,7 @@ def get_server(
paths: Sequence[Path],
host: str,
port: int,
):
) -> ThreadingHTTPServer:
"""Returns an HTTP server that serves a local datasource.
Args:
Expand Down Expand Up @@ -42,7 +44,7 @@ def do_OPTIONS(self) -> None:
self.send_header("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
self.end_headers()

def send_response_only(self, code, message=None):
def send_response_only(self, code: int, message: str | None = None) -> None:
super().send_response_only(code, message)
self.send_header(
"Cache-Control", "no-store, must-revalidate, no-cache, max-age=-1"
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ exclude = '''(?x)(
lightly/api/api_workflow_download_dataset.py |
lightly/api/bitmask.py |
lightly/api/_version_checking.py |
lightly/api/serve.py |
lightly/api/patch.py |
lightly/api/swagger_api_client.py |
lightly/api/api_workflow_collaboration.py |
Expand Down

0 comments on commit f4c4966

Please sign in to comment.