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 mypy type checking issues in utils directory #7720

Closed
wants to merge 31 commits into from

Conversation

neubig
Copy link
Contributor

@neubig neubig commented Apr 5, 2025

This PR fixes mypy type checking issues in the utils directory, which had the highest number of mypy errors. The changes include:

  • Added proper type annotations to functions and methods
  • Fixed return type annotations
  • Added proper parameter type annotations
  • Fixed issues with Any returns
  • Added proper type casting where needed

These changes help improve the type safety of the codebase and make it more maintainable.

Note: All linting configuration files have been reverted back to the main branch, so this PR only includes type annotation fixes in the utils directory.


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:99c569b-nikolaik   --name openhands-app-99c569b   docker.all-hands.dev/all-hands-ai/openhands:99c569b

openhands-agent and others added 30 commits January 21, 2025 19:12
- Update mypy configuration with stricter type checking rules
- Add more type stubs to pre-commit configuration
- Run mypy both through pre-commit and directly in CI
- Install project in editable mode for better type checking
- Set correct PYTHONPATH in CI environment
@neubig neubig self-assigned this Apr 6, 2025
@neubig
Copy link
Contributor Author

neubig commented Apr 6, 2025

Duplicate with #7489

@neubig neubig closed this Apr 6, 2025
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.

2 participants