Python 升级指南
The Backend Language Tooling (BLT) team at Lyft is responsible for the Python and Go experience for our engineers and drives each upgrade as a key part of our remit (60% of our repos have Python code!). Funnily enough, working on a Python upgrade is usually the first project for most new hires joining our team.
Lyft的后端语言工具(BLT)团队负责我们工程师的Python和Go体验,并将每次升级作为我们任务的重要组成部分(我们的60%代码库都有Python代码!)。有趣的是,对于我们团队的大多数新成员来说,参与Python升级通常是他们的第一个项目。
Keeping Python up to date has many benefits:
保持Python的最新状态有很多好处:
- keeps us secure and in compliance with patching targets
- 使我们保持安全,并符合修补目标
- enables us to access the latest versions of tools (e.g. linters) and libraries as they drop old Pythons or only work on the newest Pythons (e.g. LLM libraries) — a frequent ask from our engineering teams
- 使我们能够访问最新版本的工具(例如linters)和库,因为它们放弃了旧的Python版本或仅适用于最新的Python版本(例如LLM库) - 这是我们工程团队经常提出的要求
- especially with recent Pythons, brings efficiency gains to our fleet to control our costs
- 特别是对于最近的Python版本,可以提高我们车队的效率,以控制成本
Given breaking changes in Python and its ecosystem, we can’t do everything by ourselves. We have a few key principles for engaging with our platform partners and service teams:
鉴于Python及其生态系统中的重大变化,我们无法独自完成所有工作。我们与平台合作伙伴和服务团队进行互动时有几个关键原则:
- Communicate early and often about upcoming upgrades so teams can plan for them and know what is needed at each stage.
- 提前并经常与团队沟通即将进行的升级,以便他们可以为此做好计划,并了解每个阶段需要什么。
- Build central infrastructure and automation first; only ask teams to jump in once we have exhausted what we can do for them.
- 首先构建中央基础设施和自动化;只有在我们已经尽力为他们做了所有可能的事情后,才要求团队加入。
- Focus on the critical chain — identify “long pole” repos up front to prevent delays at the end, and prioritize based on what will unblock the most repos. Using this principle our Airflow infrastructure went from the last repo to upgrade to one of the very first!
- 专注于关键链 - 提前识别“长杆”存储库,以防止最后的延迟,并根据能够解锁最多存储库的优先级进行排序。根据这个原则,我们的 Airflow 基础设施从最后一个需要升级的存储库变成了最早的一个!
Let’s walk through our steps after sending an initial “get ready for the next upgrade” email.
让我们在发送初始的“为下一次升级做好准备”的电子邮件后,走一遍我们...