提交 bc8872bc 编写于 作者: D David Beitey

Link to PEPs in README; fix typo

上级 7521d5b5
......@@ -2,7 +2,7 @@
# PDM - Python Development Master
A modern Python package manager with PEP 582 support. [中文版本说明](README_zh.md)
A modern Python package manager with [PEP 582] support. [中文版本说明](README_zh.md)
![PDM logo](https://raw.githubusercontent.com/pdm-project/pdm/main/docs/docs/assets/logo_big.png)
......@@ -30,7 +30,7 @@ with `Pipenv` or `Poetry` and don't want to introduce another package manager,
just stick to it. But if you are missing something that is not present in those tools,
you can probably find some goodness in `pdm`.
PEP 582 proposes a project structure as below:
[PEP 582] proposes a project structure as below:
```
foo
......@@ -46,11 +46,15 @@ Read more about the specification [here](https://www.python.org/dev/peps/pep-058
## Highlights of features
- PEP 582 local package installer and runner, no virtualenv involved at all.
- [PEP 582] local package installer and runner, no virtualenv involved at all.
- Simple and relatively fast dependency resolver, mainly for large binary distributions.
- A PEP 517 build backend.
- A [PEP 517] build backend.
- A full-featured plug-in system.
- PEP 621 project metadata format.
- [PEP 621] project metadata format.
[PEP 517]: https://www.python.org/dev/peps/pep-0517
[PEP 582]: https://www.python.org/dev/peps/pep-0582
[PEP 621]: https://www.python.org/dev/peps/pep-0621
## Why not virtualenv?
......@@ -60,9 +64,9 @@ installs the virtualenv manager using a venv encapsulated Python, and create mor
which is based on an encapsulated Python. One day a minor release of Python is released and one has to check
all those venvs and upgrade them if required.
PEP 582, on the other hand, introduces a way to decouple the Python interpreter from project
environments. It is a relative new proposal and there are not many tools supporting it (one that does
is [pyflow], but it is written with Rust and thus can't get much help from the big Python community and for the same reason it can't act as a PEP 517 backend).
[PEP 582], on the other hand, introduces a way to decouple the Python interpreter from project
environments. It is a relatively new proposal and there are not many tools supporting it (one that does
is [pyflow], but it is written with Rust and thus can't get much help from the big Python community and for the same reason it can't act as a [PEP 517] backend).
## Installation
......@@ -149,7 +153,7 @@ $ pdm add requests flask
You can add multiple dependencies in the same command. After a while, check the `pdm.lock` file to see what is locked for each package.
**Run your script with PEP 582 support**
**Run your script with [PEP 582] support**
Suppose you have a script `app.py` placed next to the `__pypackages__` directory with the following content(taken from Flask's website):
......@@ -204,7 +208,7 @@ Tell people you are using PDM in your project by including the markdown code in
### 1. What is put in `__pypackages__`?
PEP 582 is a draft proposal which still needs a lot of polishing. For instance, it doesn't mention how to manage
[PEP 582] is a draft proposal which still needs a lot of polishing. For instance, it doesn't mention how to manage
CLI executables. PDM makes the decision to put `bin` and `include` together with `lib` under `__pypackages__/X.Y`.
### 2. How do I run CLI scripts in the local package directory?
......
......@@ -2,7 +2,7 @@
# PDM - Python Development Master
一个现代的 Python 包管理器,支持 PEP 582[English version README](README.md)
一个现代的 Python 包管理器,支持 [PEP 582]。[English version README](README.md)
![PDM logo](https://raw.githubusercontent.com/pdm-project/pdm/main/docs/docs/assets/logo_big.png)
......@@ -27,7 +27,7 @@ PDM 旨在成为下一代 Python 软件包管理工具。它最初是为个人
`poetry` 用着非常好,并不想引入一个新的包管理器,那么继续使用它们吧;但如果你发现有些东西这些
工具不支持,那么你很可能可以在 `pdm` 中找到。
PEP 582 提出下面这种项目的目录结构:
[PEP 582] 提出下面这种项目的目录结构:
```
foo
......@@ -43,11 +43,15 @@ foo
## 主要特性
- PEP 582 本地项目库目录,支持安装与运行命令,完全不需要虚拟环境。
- [PEP 582] 本地项目库目录,支持安装与运行命令,完全不需要虚拟环境。
- 一个简单且相对快速的依赖解析器,特别是对于大的二进制包发布。
- 兼容 PEP 517 的构建后端,用于构建发布包(源码格式与 wheel 格式)
- 兼容 [PEP 517] 的构建后端,用于构建发布包(源码格式与 wheel 格式)
- 具备一个完备的插件系统
- PEP 621 元数据格式
- [PEP 621] 元数据格式
[PEP 517]: https://www.python.org/dev/peps/pep-0517
[PEP 582]: https://www.python.org/dev/peps/pep-0582
[PEP 621]: https://www.python.org/dev/peps/pep-0621
## 为什么不用虚拟环境?
......@@ -56,9 +60,9 @@ foo
然后又用这个工具去创建更多虚拟环境。当某一天你升级了新版本的 Python 你必须一个一个去检查这些
虚拟环境,没准哪个就用不了了。
然而 PEP 582 提供了一个能把 Python 解释器和项目开发环境解耦的方法。这是一个相对比较新的提案,
然而 [PEP 582] 提供了一个能把 Python 解释器和项目开发环境解耦的方法。这是一个相对比较新的提案,
没有很多相关的工具实现它,这其中就有 [pyflow]。但 pyflow 又是用 Rust 写的,不是所有 Python 的社区
都会用 Rust,这样就没法贡献代码,而且,基于同样的原因,pyflow 并不支持 PEP 517 构建。
都会用 Rust,这样就没法贡献代码,而且,基于同样的原因,pyflow 并不支持 [PEP 517] 构建。
## 安装
......@@ -145,7 +149,7 @@ $ pdm add requests flask
你可以在同一条命令中添加多个依赖。稍等片刻完成之后,你可以查看`pdm.lock`文件看看有哪些依赖以及对应版本。
**在 PEP 582 加持下运行你的脚本**
**在 [PEP 582] 加持下运行你的脚本**
假设你在`__pypackages__`同级的目录下有一个`app.py`脚本,内容如下(从 Flask 的官网例子复制而来):
......@@ -194,7 +198,7 @@ $ python /home/frostming/workspace/flask_app/app.py
### 1. `__pypackages__` 里都包含什么?
PEP 582 尚处于草案阶段,还需要补充很多细节,比如提案中并未说明可执行程序应该如何存放。PDM 会把 `bin`(可执行程序), `include`(头文件),
[PEP 582] 尚处于草案阶段,还需要补充很多细节,比如提案中并未说明可执行程序应该如何存放。PDM 会把 `bin`(可执行程序), `include`(头文件),
以及 `lib` 都放在 `__pypackages__/X.Y` 下面。
### 2. 如何运行 `__pypackages__` 下的可执行程序?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册