为Poetry命令创建别名
项目描述
poetry-aliases
poetry-aliases是一个Poetry插件,它允许为Poetry命令创建别名。
安装
poetry self add poetry-aliases
使用方法
首先,通过poetry aliases
添加别名。
poetry aliases
poetry aliases
将在$EDITOR
中打开一个文件,您可以在其中查看、添加和编辑您的别名。
# Write each alias on a separate line, e.g.:
# i = "install"
# r = "remove"
# dev = "add --group dev"
# plugins = "self show plugins"
# Aliases that are not strings or conflict with other Poetry commands will be ignored.
# Save this file and close the editor when you're done.
i = "install"
r = "remove"
dev = "add --group dev"
plugins = "self show plugins"
您的别名将被保存到Poetry的config.toml
文件中。
一旦您的别名已保存,您就可以像使用任何其他Poetry命令一样使用它们。
poetry i
# Installing dependencies from lock file
poetry r yapf
# Package operations: 0 installs, 0 updates, 1 removal
# • Removing yapf (0.32.0)
poetry dev black
# Package operations: 3 installs, 0 updates, 0 removals
# • Installing mypy-extensions (0.4.3)
# • Installing pathspec (0.11.0)
# • Installing black (23.1.0)
poetry plugins
# • poetry-aliases (1.0.0) Create aliases for Poetry commands
# 1 application plugin
#
# Dependencies
# - click (>=8.1.3,<9.0.0)
# - poetry (>=1.3.2,<2.0.0)
许可证
poetry-aliases遵循MIT许可证。