pkg.soopen package index

brew / rank 3276

Install pyupgrade with Homebrew, apt, MacPorts, Nix, pacman

Upgrade syntax for newer versions of Python. Version 3.21.2 via Homebrew; verified from local package data. Also installable with debian: sudo apt install pyupgrade.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install pyupgrade

local Homebrew formula metadata

MacPortsverified · 94%
sudo port install pyupgrade

MacPorts ports tree · python/pyupgrade/Portfile · source: api.github.com

overview

Package summary

Upgrade syntax for newer versions of Python

Commands and aliases

  • pyupgrade

history

Project history and usage

pyupgrade is a Python source modernizer, usable directly or as a pre-commit hook, that rewrites syntax and compatibility patterns when newer Python versions are permitted.

Project history

Anthony Sottile developed pyupgrade as a command-line program and pre-commit hook for automatically modernizing Python syntax. The project accumulated transformations for language changes ranging from set literals and f-strings to removal of Python 2 compatibility constructs and outdated standard-library aliases.

The tool follows an explicit-target model: maintainers select flags such as `--py36-plus` or later equivalents so rewrites are constrained by the minimum Python version their project supports.

Adoption history

pyupgrade became available across several packaging ecosystems, including PyPI, Homebrew, Debian and Ubuntu, MacPorts, Arch Linux, and Nix. Its official pre-commit hook also made it straightforward to apply automatically during commits.

How it is used

Users run `pyupgrade` against Python files or configure its official pre-commit hook. Minimum-version flags enable transformations that would be unsafe for older interpreters.

Typical use accompanies a minimum-supported-Python bump, removes redundant compatibility code, and modernizes constructs such as formatting expressions, imports, type declarations, and standard-library aliases.

Why package nerds care

pyupgrade captures Python-version migration knowledge as repeatable source transformations. Package maintainers value it because raising a project's minimum Python version can be followed by a mechanical cleanup of obsolete compatibility syntax, imports, and idioms.

Timeline

  • Early project: pyupgrade was established as both a standalone command and a pre-commit hook.
  • Subsequent development: Version-target flags and an extensive catalog of syntax, import, and compatibility rewrites were added.
  • Ongoing adoption: The tool is packaged by multiple Unix-like operating-system and language-package ecosystems.

Related projects

  • pre-commit provides the hook framework documented by pyupgrade.
  • python-modernize and six address older Python compatibility concerns that pyupgrade can remove when a project no longer needs those compatibility layers.
  • reorder-python-imports is another source-maintenance tool referenced by the official README.

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 1 platform targets.
  • Installs with 1 runtime dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
pyupgradecliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-09-19
manager version3.21.2
manager updated
local dataok
upstreamnot checked
latest detectednot detected

https://github.com/asottile/pyupgrade

install metadata

Package metadata

Package keybrew:pyupgrade
Version3.21.2
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/pyupgrade
Homepagehttps://github.com/asottile/pyupgrade
Repositoryhttps://github.com/asottile/pyupgrade
LicenseMIT
Source archivehttps://files.pythonhosted.org/packages/7f/a1/dc63caaeed232b1c58eae1b7a75f262d64ab8435882f696ffa9b58c0c415/pyupgrade-3.21.2.tar.gz
Dependenciespython@3.14
Bottleavailable (on all)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namepyupgrade
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Debian apt95%

pyupgrade 3.19.1-1

Tool to automatically upgrade Python 3 syntax for newer versions

https://github.com/asottile/pyupgrade

sudo apt install pyupgrade
  • Section: devel
  • Architecture: all
  • 2 dependencies
  • normalized package name match
  • Matched by: Pyupgrade
Debian stable package indexes · deb.debian.org · Debian stable package indexes: pyupgrade from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

pyupgrade

nix profile install nixpkgs#pyupgrade
  • normalized package name match
  • Matched by: Pyupgrade
nixpkgs package indexes · raw.githubusercontent.com · nixpkgs package indexes: pyupgrade from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
Ubuntu apt95%

pyupgrade 2.37.1-2

Tool to automatically upgrade Python 3 syntax for newer versions

https://github.com/asottile/pyupgrade

sudo apt install pyupgrade
  • Section: universe/devel
  • Architecture: all
  • 2 dependencies
  • normalized package name match
  • Matched by: Pyupgrade
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: pyupgrade from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
pacman95%

pyupgrade 3.21.2-1

A tool to automatically upgrade syntax for newer versions of the language

https://github.com/asottile/pyupgrade

sudo pacman -S pyupgrade
  • License: MIT
  • Architecture: any
  • 2 dependencies
  • normalized package name match
  • Matched by: Pyupgrade
Arch Linux sync databases · geo.mirror.pkgbuild.com · Arch Linux sync databases: pyupgrade from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz
MacPorts95%

pyupgrade

sudo port install pyupgrade
  • normalized package name match
  • Matched by: Pyupgrade
MacPorts ports tree · api.github.com · MacPorts ports tree: python/pyupgrade/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment
  • pkg.so package database
  • pkgdb category and tag curation