Increasing velocity by modernizing a Python codebase

概要

  • Ramp社の機械学習ワークフローのリポジトリのPythonコードベースを洗練させ、開発のベロシティを上げた話
  • 具体的な取り組みは以下
    • We adopted poetry for dependency management, which allowed us to manage a complex web of dependencies and ensure consistency across environments
    • We adopted ruff for formatting and linting, which allowed us to enforce consistent formatting and catch small errors
    • We adopted pytest for testing, which allowed us to catch corner cases and bad assumptions
    • We adopted mypy for type checking, which allowed us to catch type-related bugs
    •  
  • 弊社とかなり近そう
 
  • mypy
    • mypyを初めて実行すると、数百ものエラーが出てきて、全てを一度に修正するのは困難なので、エラーに対してを追加してから、徐々に旧コードを修正していくいった
    • uffのようにmypyには自動でを追加するオプションがないため、このプロセスを自動化するスクリプトを書いた