常用命令工具记录
几个命令工具的备忘录,纯自用,忘了啥写啥。
Poetry
poetry env [use {python}] 创建虚拟环境,使用 poetry shell 激活当前目录虚拟环境
poetry add {package_name} 当前目录增加包,若不存在虚拟环境则会创建
poetry init 当前目录创建包
poetry build/publish 打包/发布包
poetry config 配置 poetry 的默认行为,例如: poetry config virtualenvs.in-project true 设置默认将虚拟环境创建在项目文件内
希望 poetry 使用 PYPI 镜像,需要在 pyproject.toml 添加如下配置:
[[tool.poetry.source]]
name = "tsinghua"
default = true
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
Future will add more.
2 March 2021