AI News AI资讯 5h ago Updated 2h ago 更新于 2小时前 41

EVE Online: The Move to Python 3 Begins! EVE Online:开始向Python 3迁移!

EVE Online, running on Stackless Python since 2003, is beginning its long-delayed migration from Python 2.7 (last upgraded in 2010) to Python 3 The upgrade process starts with the `futurize` script applied against 2.4 million lines of code, followed by manual review of approximately 20,000 behavior differences between Python 2 and 3 EVE Online has already laid groundwork for leaving Stackless behind, having replaced it in their Carbon engine for EVE Frontier using their open-source `carbonengine EVE Online 启动从 Python 2.7 到 Python 3 的重大迁移,代码库规模达240万行 采用 futurize 脚本自动化转换后,手动审查约20000处 Python 2/3 行为差异点 Stackless Python 的替代方案已在 EVE Frontier 的 Carbon 引擎中验证,使用开源 carbonengine/scheduler 库

58
Hot 热度
62
Quality 质量
55
Impact 影响力

Analysis 深度分析

TL;DR

  • EVE Online, running on Stackless Python since 2003, is beginning its long-delayed migration from Python 2.7 (last upgraded in 2010) to Python 3
  • The upgrade process starts with the futurize script applied against 2.4 million lines of code, followed by manual review of approximately 20,000 behavior differences between Python 2 and 3
  • EVE Online has already laid groundwork for leaving Stackless behind, having replaced it in their Carbon engine for EVE Frontier using their open-source carbonengine/scheduler library
  • This represents one of the most significant real-world Python-at-scale migration case studies, spanning over two decades of production code

Why It Matters

This migration is a landmark case study for any organization maintaining large Python 2 codebases, demonstrating the practical challenges of upgrading a 2.4-million-line production system that has been running for over two decades. The approach—automated tooling followed by targeted manual review of behavioral differences—offers a replicable blueprint for similar enterprise migrations.

Technical Details

  • Codebase scale: 2.4 million lines of Python code, with approximately 20,000 identified locations where Python 2 and 3 behavior diverge
  • Migration methodology: Uses the futurize script (part of the future library) for automated conversion, followed by careful manual review of semantic differences such as integer division (1/2 returning 0 in Python 2 vs 0.5 in Python 3)
  • Stackless Python decommissioning: The team has already developed and open-sourced carbonengine/scheduler, a replacement for Stackless Python's microtask scheduling, first deployed in the Carbon engine for EVE Frontier
  • Historical context: Stackless Python has been the runtime since the game's 2003 launch, with the last major Python upgrade occurring in 2010 to Stackless Python 2.7

Industry Insight

  • Large-scale Python 2-to-3 migrations remain relevant well beyond the 2020 EOF deadline for organizations with legacy codebases; the EVE Online case demonstrates that even well-resourced teams may delay such migrations for over a decade
  • The open-sourcing of their scheduling library (carbonengine/scheduler) provides a valuable reference for other projects looking to decouple from Stackless Python while maintaining concurrent task execution patterns
  • The hybrid approach of automated tooling (futurize) combined with targeted manual review of behavioral edge cases is a proven strategy that other teams should adopt rather than attempting purely manual or purely automated migrations

TL;DR

  • EVE Online 启动从 Python 2.7 到 Python 3 的重大迁移,代码库规模达240万行
  • 采用 futurize 脚本自动化转换后,手动审查约20000处 Python 2/3 行为差异点
  • Stackless Python 的替代方案已在 EVE Frontier 的 Carbon 引擎中验证,使用开源 carbonengine/scheduler 库

为什么值得看

EVE Online 作为运行超过20年的大规模 Python 项目,其 Python 3 迁移经验对长期维护的大型代码库具有重要参考价值。Stackless Python 的替代方案为需要自定义调度器的项目提供了可复用的开源解决方案。

技术解析

  • 迁移规模与工具链:240万行代码库使用 futurize 脚本进行自动化转换,该脚本是 Python 2/3 迁移工具包的一部分,可处理大部分语法层面的自动转换。
  • 差异审查策略:约20000处 Python 2 和 3 行为差异需要人工审查,典型例子是整数除法行为变化(Python 2 中 1/2=0,Python 3 中 1/2=0.5)。
  • Stackless 替代方案:自2003年上线以来一直使用 Stackless Python,2010年升级到 2.7 版本。迁移计划中未明确说明如何替换 Stackless,但去年会议展示了在 Carbon 引擎中使用 carbonengine/scheduler 开源库的成功经验。
  • 技术债务背景:距离上次重大升级已过去16年,项目积累了大量 Python 2 时代的代码模式和依赖。

行业启示

  • 超大规模代码库的 Python 3 迁移需要分层策略:自动化脚本处理语法转换 + 人工审查处理语义差异,避免一次性全量替换带来的风险。
  • Stackless Python 等小众/遗留技术栈可通过开源调度库替代,降低对特定运行时实现的依赖,提升技术栈的可维护性。
  • 长期项目应建立定期技术栈评估机制,16年的升级间隔表明许多项目存在严重的技术债务滞后风险。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Gaming 游戏 Programming 编程 Open Source 开源