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

fix: Add missing type annotations in utils/ directory #6687

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

neubig
Copy link
Contributor

@neubig neubig commented Feb 11, 2025

This PR adds missing type annotations to files in the utils/ directory:

  • Added return type annotations to all functions in prompt.py
  • Added parameter and return type annotations to methods in http_session.py
  • Added return type annotations to all functions in shutdown_listener.py
  • Fixed the return type in tenacity_stop.py by explicitly casting to bool

All mypy checks now pass for the utils directory.

Part of #6397


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:30c441d-nikolaik   --name openhands-app-30c441d   docker.all-hands.dev/all-hands-ai/openhands:30c441d

@neubig neubig self-assigned this Feb 12, 2025

def close(self):
@property
def headers(self) -> CaseInsensitiveDict[str]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is necessary because it is used, e.g. in this file:
openhands/runtime/builder/remote.py

@neubig neubig requested a review from tofarr February 12, 2025 21:54
@neubig neubig marked this pull request as ready for review February 12, 2025 21:54
@neubig neubig assigned tofarr and unassigned neubig Feb 12, 2025
@neubig neubig removed the request for review from tofarr February 18, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants