Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/introduction/virtualenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,12 @@ pipenv install tox

**安装:**

Poetry 自身应安装在独立虚拟环境中,不要安装到系统 Python 或 Poetry 将要管理的项目虚拟环境。
按照 [Poetry 官方安装说明](https://python-poetry.org/docs/#installation),推荐使用 [pipx](https://pipx.pypa.io/stable/) 安装;pipx 会为 Poetry 创建和维护隔离环境,同时让 `poetry` 命令可在各项目中使用。

```bash
pip install poetry
pipx install poetry
poetry --version
```

**使用:**
Expand Down
8 changes: 6 additions & 2 deletions docs/practices/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@

### 1.3 虚拟环境工具

推荐使用 [poetry](https://python-poetry.org/)。poetry 相比使用 `requirements.txt` 管理依赖列表,更加强大。它支持同时管理开发生产环境依赖,自动查找虚拟环境,生成依赖锁定文件等其他特性。
推荐使用 [Poetry](https://python-poetry.org/)。Poetry 相比使用 `requirements.txt` 管理依赖列表,更加强大。它支持同时管理开发生产环境依赖,自动查找虚拟环境,生成依赖锁定文件等其他特性。

在安装好 Python 环境后,应该在全局环境中安装 poetry 。
Poetry 命令可以在各项目中使用,但它自身的依赖应与系统 Python 和项目环境隔离。建议按照 [Poetry 官方安装说明](https://python-poetry.org/docs/#installation),使用 [pipx](https://pipx.pypa.io/stable/) 将 Poetry 安装到独立虚拟环境中:

```bash
pipx install poetry
```

### 1.4 Git 使用

Expand Down
11 changes: 6 additions & 5 deletions docs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@

推荐使用 [Poetry](https://python-poetry.org/) ,既包含了虚拟环境管理工具也支持打包发布等功能。

在安装好 Python 环境后,应该在全局环境中安装 [Poetry](https://python-poetry.org/) 。
Poetry 作为命令行工具可以在各项目中使用,但不应安装到系统 Python 或它所管理的项目虚拟环境中。推荐使用 [pipx](https://pipx.pypa.io/stable/) 为 Poetry 创建独立虚拟环境,并让 `poetry` 命令可在各项目中使用。
若尚未安装 pipx,请先按照其[官方安装说明](https://pipx.pypa.io/stable/how-to/install-pipx.html)完成安装。

```bash
sudo python -m pip install -U pip
sudo pip install -U poetry
pipx install poetry
poetry --version
```

### 1.4 初始化项目

[cookiecutter](https://cookiecutter.readthedocs.io/en/1.7.2/README.html) 是一个通过项目模板创建项目的命令行工具。
[cookiecutter](https://cookiecutter.readthedocs.io/en/stable/) 是一个通过项目模板创建项目的命令行工具。

安装 cookiecutter

```bash
sudo pip3 install -U cookiecutter
pipx install cookiecutter
```

初始化项目
Expand Down