Wan2.1/mypy.ini
Claude 59d86dfe65
ci: add GitHub Actions CI/CD pipeline and pre-commit hooks
Implements automated testing, code quality checks, and dependency management
for continuous integration and deployment.

GitHub Actions Workflows:
- Code quality & linting (YAPF, Black, isort, mypy)
- CPU-based unit tests for Python 3.10 and 3.11
- Security scanning (safety, bandit)
- Package building and validation
- Documentation building

Pre-commit Hooks:
- File checks (trailing whitespace, EOF, YAML/JSON validation)
- Code formatting (YAPF, Black)
- Import sorting (isort)
- Linting (flake8)
- Type checking (mypy)
- Security checks (bandit)
- Docstring coverage (interrogate)
- Markdown linting

Dependabot Configuration:
- Weekly dependency updates for Python packages
- Grouped updates for related ecosystems (PyTorch, Transformers)
- Automatic PR creation with labels and reviewers
- Security-focused update strategy

Type Checking:
- mypy.ini with gradual typing configuration
- External dependency stub configuration
- Per-module strictness levels

Files Added:
- .github/workflows/ci.yml - CI/CD pipeline
- .github/dependabot.yml - Dependency updates
- .github/pull_request_template.md - PR template
- .github/ISSUE_TEMPLATE/bug_report.yml - Bug report template
- .github/ISSUE_TEMPLATE/feature_request.yml - Feature request template
- .pre-commit-config.yaml - Pre-commit hooks
- mypy.ini - Type checking configuration

Benefits:
- Automated code quality enforcement
- Early detection of bugs and security issues
- Consistent code style across contributors
- Reduced manual review burden
2025-11-19 04:25:02 +00:00

98 lines
1.8 KiB
INI

[mypy]
# Mypy configuration for Wan2.1
# Run with: mypy wan
# Global options
python_version = 3.10
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = False
disallow_incomplete_defs = False
check_untyped_defs = True
disallow_untyped_decorators = False
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_no_return = True
warn_unreachable = True
strict_equality = True
show_error_codes = True
show_column_numbers = True
pretty = True
# Import discovery
namespace_packages = True
ignore_missing_imports = True
follow_imports = normal
# Suppress errors for external dependencies
[mypy-torch.*]
ignore_missing_imports = True
[mypy-torchvision.*]
ignore_missing_imports = True
[mypy-transformers.*]
ignore_missing_imports = True
[mypy-diffusers.*]
ignore_missing_imports = True
[mypy-flash_attn.*]
ignore_missing_imports = True
[mypy-accelerate.*]
ignore_missing_imports = True
[mypy-xfuser.*]
ignore_missing_imports = True
[mypy-gradio.*]
ignore_missing_imports = True
[mypy-PIL.*]
ignore_missing_imports = True
[mypy-cv2.*]
ignore_missing_imports = True
[mypy-av.*]
ignore_missing_imports = True
[mypy-dashscope.*]
ignore_missing_imports = True
[mypy-openai.*]
ignore_missing_imports = True
[mypy-safetensors.*]
ignore_missing_imports = True
[mypy-einops.*]
ignore_missing_imports = True
[mypy-scipy.*]
ignore_missing_imports = True
[mypy-setuptools.*]
ignore_missing_imports = True
# Per-module options for gradual typing adoption
[mypy-wan.modules.*]
# Core modules - stricter checking
disallow_untyped_defs = False
check_untyped_defs = True
[mypy-wan.utils.*]
# Utilities - moderate checking
check_untyped_defs = True
[mypy-wan.distributed.*]
# Distributed code - moderate checking
check_untyped_defs = True
[mypy-tests.*]
# Tests can be less strict
ignore_errors = False
check_untyped_defs = False