pkg.soopen package index

brew / 排名 3276

使用 Homebrew, apt, MacPorts, Nix, pacman 安装 pyupgrade

查看 pyupgrade 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install pyupgrade

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install pyupgrade

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

概览

软件包摘要

Upgrade syntax for newer versions of Python

命令和别名

  • pyupgrade

历史

项目历史与用法

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.

项目历史

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.

采用历史

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.

使用方式

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.

为什么软件包爱好者会关心

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.

时间线

  • 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.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 1 个平台目标。
  • 安装时包含 1 个运行时依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
pyupgradecli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-09-19
管理器版本3.21.2
管理器更新时间
本地数据OK
上游not checked
检测到的最新版本未检测到

https://github.com/asottile/pyupgrade

安装元数据

软件包元数据

软件包键brew:pyupgrade
版本3.21.2
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/pyupgrade
主页https://github.com/asottile/pyupgrade
仓库https://github.com/asottile/pyupgrade
许可证MIT
源码归档https://files.pythonhosted.org/packages/7f/a1/dc63caaeed232b1c58eae1b7a75f262d64ab8435882f696ffa9b58c0c415/pyupgrade-3.21.2.tar.gz
依赖python@3.14
Bottle可用 (于 all)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

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

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

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 依赖
  • normalized package name match
  • 匹配方式: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
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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
  • 匹配方式: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

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • 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