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 errors in security/invariant directory #6908

Merged
merged 13 commits into from
Feb 24, 2025

Conversation

neubig
Copy link
Contributor

@neubig neubig commented Feb 24, 2025

This PR fixes mypy errors in the security/invariant directory:

  • Fix default_factory type in Event class by using lambda to create dict
  • Add missing type annotations to rich_repr method with correct return type
  • Add missing type annotations to _Policy and _Monitor classes

The changes are limited to the specified directory and do not affect other parts of the codebase.


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

openhands-agent and others added 11 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
- Fix default_factory type in Event class
- Add missing type annotations to __rich_repr__ method
- Add missing type annotations to _Policy and _Monitor classes
@neubig neubig changed the base branch from feature/strict-mypy-checks to main February 24, 2025 01:21
Handle case where monitor.check() returns an Exception instead of a tuple
@neubig neubig marked this pull request as ready for review February 24, 2025 01:34
@neubig neubig merged commit 753e3c4 into main Feb 24, 2025
14 checks passed
@neubig neubig deleted the fix/mypy-invariant-security branch February 24, 2025 15:00
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