macOS
brew install pyupgradelocal Homebrew formula metadata
sudo port install pyupgradeMacPorts ports tree · python/pyupgrade/Portfile · 来源: api.github.com
安装
brew install pyupgradelocal Homebrew formula metadata
sudo port install pyupgradeMacPorts ports tree · python/pyupgrade/Portfile · 来源: api.github.com
sudo apt install pyupgradeDebian stable package indexes · pyupgrade · 来源: deb.debian.org
nix profile install nixpkgs#pyupgradenixpkgs package indexes · pyupgrade · 来源: raw.githubusercontent.com
sudo pacman -S pyupgradeArch Linux sync databases · pyupgrade · 来源: geo.mirror.pkgbuild.com
概览
Upgrade syntax for newer versions of Python
历史
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.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
pyupgrade | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
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 Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | pyupgrade |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
pyupgrade 3.19.1-1
Tool to automatically upgrade Python 3 syntax for newer versions
https://github.com/asottile/pyupgrade
sudo apt install pyupgradepyupgrade
nix profile install nixpkgs#pyupgradepyupgrade 2.37.1-2
Tool to automatically upgrade Python 3 syntax for newer versions
https://github.com/asottile/pyupgrade
sudo apt install pyupgradepyupgrade 3.21.2-1
A tool to automatically upgrade syntax for newer versions of the language
https://github.com/asottile/pyupgrade
sudo pacman -S pyupgradepyupgrade
sudo port install pyupgrade来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.