pyupgrade
« Back to VersTracker
Description:
Upgrade syntax for newer versions of Python
Type: Formula  |  Latest Version: 3.21.2@0  |  Tracked Since: Nov 8, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: python code-quality refactoring developer-tools syntax
Install: brew install pyupgrade
About:
pyupgrade is a command-line tool that automatically upgrades Python code to newer syntax versions. It refactors code to use modern features like f-strings, type hints, and improved literals. This helps maintain cleaner, more readable codebases and reduces technical debt.
Key Features:
  • Automatically converts old string formatting to f-strings
  • Upgrades deprecated syntax to modern Python standards
  • Supports Python 2.7 and 3.6+ codebases
  • Configurable via command-line arguments
  • Safe transformations with minimal risk
Use Cases:
  • Migrating legacy Python projects to newer versions
  • Enforcing consistent modern syntax across a codebase
  • Automated code cleanup in CI/CD pipelines
Alternatives:
  • 2to3 – 2to3 focuses on Python 2 to 3 migration, while pyupgrade handles ongoing syntax modernization across versions
  • black – Black focuses on code formatting, while pyupgrade focuses on syntax modernization
Version History
Detected Version Rev Change Commit
Nov 8, 2025 11:18pm 0 VERSION_BUMP 1ca45b22
Oct 9, 2025 10:39pm 0 VERSION_BUMP 3dee16ef
Dec 17, 2024 3:13am 0 VERSION_BUMP 5560bf69
Dec 17, 2024 2:35am 0 VERSION_BUMP 18bf0ba6
Oct 22, 2024 12:57am 0 VERSION_BUMP f2bba221
Oct 12, 2024 1:06am 0 VERSION_BUMP b263f3c5
Oct 10, 2024 2:24am 0 VERSION_BUMP 132571e9
Oct 9, 2024 6:36pm 0 VERSION_BUMP 7e5cb888