cog
30151726 - feat: Rename predict to run with backward compatibility (#3015)

Commit
103 days ago
feat: Rename predict to run with backward compatibility (#3015) * feat: Rename predict to run with backward compatibility Rename the user-facing predict concept to run across the entire stack: - CLI: cog predict → cog run (predict kept as deprecated alias) - Python SDK: BasePredictor → BaseRunner, predict() → run() - Config: predict: → run: in cog.yaml - Examples: predict.py → run.py, Predictor → Runner Backward compatibility maintained throughout: - cog predict still works with deprecation warning - BasePredictor kept as alias for BaseRunner - predict() method still works - predict: in cog.yaml still accepted Also includes: - Doctor check with auto-migration for common patterns - Integration tests for both legacy and new interfaces - Updated documentation and examples * fix: address predict to run review feedback * fix: repair predict migration integration test * fix: use tree-sitter for predict migration * fix: address predict to run migration edge cases * fix: remove unused parser assignment * fix: address predict-to-run migration review feedback - Add deprecation warning to BaseRunner.predict() bridge - Rename _validate_predict to _validate_run_or_predict for clarity - Add BaseRunner core feature tests (setup, weights, stateful, multiple inputs) - Add run() tests for complex types in inspector tests - Add predict_legacy_predictor integration test for common migration path - Add doctor_predict_to_run_collision test for file conflict handling - Add run_legacy_async_predictor integration test - Verify cog init template uses BaseRunner/run() in integration tests - Add Rust test for BasePredictor inheritance - Fix documentation terminology (predictor→runner, predict function→run function) * fix: address CI failures and review feedback - Fix Python formatting (ruff) - Regenerate docs/llms.txt to match updated docs - Fix doctor integration tests to expect non-zero exit code when issues found - Clean up variable declarations in pkg/schema/python/parser.go * fix: address run migration review feedback * fix: restore doctor warning command expectations * fix: update run docs wording * fix: address follow-up review feedback * fix: stabilize doctor integration checks
Author
Parents
Loading