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

Adding type check for serve.py #1652

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lightly/api/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
paths: Sequence[Path],
host: str,
port: int,
):
) -> ThreadingHTTPServer:
"""Returns an HTTP server that serves a local datasource.

Args:
Expand Down Expand Up @@ -42,7 +42,7 @@
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:

Check warning on line 45 in lightly/api/serve.py

View check run for this annotation

Codecov / codecov/patch

lightly/api/serve.py#L45

Added line #L45 was not covered by tests
guarin marked this conversation as resolved.
Show resolved Hide resolved
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
Loading