Skip to content

Commit

Permalink
doc(#1840): Remove advertizing of PEP-582 from Feature highlights
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Apr 19, 2023
1 parent 10e7e11 commit 8ce8602
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 49 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ you can probably find some goodness in `pdm`.

## Highlights of features

- Opt-in [PEP 582] support, no virtualenv involved at all.
- Simple and fast dependency resolver, mainly for large binary distributions.
- A [PEP 517] build backend.
- [PEP 621] project metadata.
Expand All @@ -44,7 +43,6 @@ you can probably find some goodness in `pdm`.
- Opt-in centralized installation cache like [pnpm](https://pnpm.io/motivation#saving-disk-space-and-boosting-installation-speed).

[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
[pnpm]: https://pnpm.io/motivation#saving-disk-space-and-boosting-installation-speed

Expand Down Expand Up @@ -72,8 +70,9 @@ Hatch can also manage environments (it allows multiple environments per project,

### This project

PDM also can manage venvs, both in project and centralized location as Pipenv does. It reads the project metadata from a standardized `pyproject.toml` file, and has lockfile support. Users can add more functionalities in a plugin and upload it as a distribution for sharing.
Besides, PDM has an experimental [PEP 582] support([docs](https://pdm.fming.dev/latest/usage/pep582/)), which means you can install packages without creating a virtual environment. Moreover, unlike Poetry and Hatch, PDM isn't locked to a specific build backend, you can choose any build backend you like.
PDM can manage virtual environments (venvs) in both project and centralized locations, similar to Pipenv. It reads project metadata from a standardized `pyproject.toml` file and supports lockfiles. Users can add additional functionality through plugins, which can be shared by uploading them as distributions.

Unlike Poetry and Hatch, PDM is not limited to a specific build backend; users have the freedom to choose any build backend they prefer.

## Installation

Expand Down
5 changes: 2 additions & 3 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ PDM 旨在成为下一代 Python 软件包管理工具。它最初是为个人

## 主要特性

- [PEP 582] 支持,完全不需要虚拟环境。
- 一个简单且相对快速的依赖解析器,特别是对于大的二进制包发布。
- 兼容 [PEP 517] 的构建后端,用于构建发布包(源码格式与 wheel 格式)
- 灵活且强大的插件系统
Expand All @@ -37,7 +36,6 @@ PDM 旨在成为下一代 Python 软件包管理工具。它最初是为个人
-[pnpm] 一样的中心化安装缓存,节省磁盘空间

[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
[pnpm]: https://pnpm.io/motivation#saving-disk-space-and-boosting-installation-speed

Expand All @@ -61,7 +59,8 @@ Hatch 也可以管理环境(它允许每个项目有多个环境,但不允
### 本项目

PDM 也可以像 Pipenv 那样在项目或集中的位置管理 venvs。它从一个标准化的 `pyproject.toml` 文件中读取项目元数据,并支持 lockfile。用户可以在插件中添加更多的功能,并将其作为一个发行版上传,以供分享。
此外,PDM有一个实验性的 [PEP 582] 支持([docs](https://pdm.fming.dev/latest/usage/pep582/)),这意味着你可以在不创建虚拟环境的情况下安装包。此外,与 Poetry 和 Hatch 不同,PDM 并没有被和一个特定的构建后端绑定,你可以选择任何你喜欢的构建后端。

此外,与 Poetry 和 Hatch 不同,PDM 并没有被和一个特定的构建后端绑定,你可以选择任何你喜欢的构建后端。

## 安装

Expand Down
9 changes: 5 additions & 4 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ in a similar way to `npm` that doesn't need to create a virtualenv at all!

## Feature highlights

- Opt-in [PEP 582] support, no virtualenv involved at all.
- Simple and fast dependency resolver, mainly for large binary distributions.
- A [PEP 517] build backend.
- [PEP 621] project metadata.
Expand All @@ -20,7 +19,6 @@ in a similar way to `npm` that doesn't need to create a virtualenv at all!
- Opt-in centralized installation cache like [pnpm](https://pnpm.io/motivation#saving-disk-space-and-boosting-installation-speed).

[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
[pnpm]: https://pnpm.io/motivation#saving-disk-space-and-boosting-installation-speed

Expand Down Expand Up @@ -200,8 +198,11 @@ PDM supports generating completion scripts for Bash, Zsh, Fish or Powershell. He

## Virtualenv and PEP 582

In addition to the virtualenv management, PDM supports [PEP 582](https://www.python.org/dev/peps/pep-0582/) as an opt-in feature.
You can learn more about the two modes in the corresponding chapters in [Working with virtualenv](usage/venv.md) and [Working with PEP 582](usage/pep582.md)
PDM offers experimental support for [PEP 582](https://www.python.org/dev/peps/pep-0582/) as an opt-in feature, in addition to virtualenv management. Although [the Python Steering Council has rejected PEP 582][rejected], you can still test it out using PDM.

To learn more about the two modes, refer to the relevant chapters on [Working with virtualenv](usage/venv.md) and [Working with PEP 582](usage/pep582.md).

[rejected]: https://discuss.python.org/t/pep-582-python-local-packages-directory/963/430

## PDM Eco-system

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A build backend is what drives the build system to build source distributions and wheels from arbitrary source trees.

If you run [`pdm init`](../reference/cli.md#exec-0--init), PDM will let you choose the build backend to use. Unlike other package managers, PDM does not force you to use a specific build backend. You can choose the one you like. Here is a list of build backends and corresponding configurations initially supported by PDM:
If you run [`pdm init`](../reference/cli.md#init), PDM will let you choose the build backend to use. Unlike other package managers, PDM does not force you to use a specific build backend. You can choose the one you like. Here is a list of build backends and corresponding configurations initially supported by PDM:

=== "pdm-backend"

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/cli.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CLI Reference

```python exec="true"
```python exec="1" idprefix=""
import argparse
from pdm.core import Core

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configurations

[pdm-config]: ../reference/cli.md#exec-0--config
[pdm-config]: ../reference/cli.md#config

## Color Theme

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/usage/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ commands =
```

To use the virtualenv created by Tox, you should make sure you have set `pdm config python.use_venv true`. PDM then will install
dependencies from [`pdm lock`](../reference/cli.md#exec-0--lock) into the virtualenv. In the dedicated venv you can directly run tools by `pytest tests/` instead
dependencies from [`pdm lock`](../reference/cli.md#lock) into the virtualenv. In the dedicated venv you can directly run tools by `pytest tests/` instead
of `pdm run pytest tests/`.

You should also make sure you don't run `pdm add/pdm remove/pdm update/pdm lock` in the test commands, otherwise the [`pdm lock`](../reference/cli.md#exec-0--lock)
You should also make sure you don't run `pdm add/pdm remove/pdm update/pdm lock` in the test commands, otherwise the [`pdm lock`](../reference/cli.md#lock)
file will be modified unexpectedly. Additional dependencies can be supplied with the `deps` config. Besides, `isolated_buid` and `passenv`
config should be set as the above example to make PDM work properly.

Expand Down Expand Up @@ -94,7 +94,7 @@ Before running nox, you should also ensure configuration item `python.use_venv`

### About PEP 582 `__pypackages__` directory

By default, if you run tools by [`pdm run`](../reference/cli.md#exec-0--run), `__pypackages__` will be seen by the program and all subprocesses created by it. This means virtual environments created by those tools are also aware of the packages inside `__pypackages__`, which result in unexpected behavior in some cases.
By default, if you run tools by [`pdm run`](../reference/cli.md#run), `__pypackages__` will be seen by the program and all subprocesses created by it. This means virtual environments created by those tools are also aware of the packages inside `__pypackages__`, which result in unexpected behavior in some cases.
For `nox`, you can avoid this by adding a line in `noxfile.py`:

```python
Expand Down Expand Up @@ -219,7 +219,7 @@ Look at the [🚀 Example repository](https://github.com/pdm-project/pdm-example

### Export `requirements.txt` or `setup.py`

This hook wraps the command `pdm export` along with any valid argument. It can be used as a hook (e.g., for CI) to ensure that you are going to check in the codebase a `requirements.txt` or a `setup.py` file, which reflects the actual content of [`pdm lock`](../reference/cli.md#exec-0--lock).
This hook wraps the command `pdm export` along with any valid argument. It can be used as a hook (e.g., for CI) to ensure that you are going to check in the codebase a `requirements.txt` or a `setup.py` file, which reflects the actual content of [`pdm lock`](../reference/cli.md#lock).

```yaml
# export python requirements
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/usage/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ The caches are located in `$(pdm config cache_dir)/packages`. You can view the c

## Configure the repositories for upload

When using the [`pdm publish`](../reference/cli.md#exec-0--publish) command, it reads the repository secrets from the *global* config file(`<CONFIG_ROOT>/config.toml`). The content of the config is as follows:
When using the [`pdm publish`](../reference/cli.md#publish) command, it reads the repository secrets from the *global* config file(`<CONFIG_ROOT>/config.toml`). The content of the config is as follows:

```toml
[repository.pypi]
Expand All @@ -207,7 +207,7 @@ A PEM-encoded Certificate Authority bundle (`ca_certs`) can be used for local /
You don't need to configure the `url` for `pypi` and `testpypi` repositories, they are filled by default values.
The username, password, and certificate authority bundle can be passed in from the command line for `pdm publish` via `--username`, `--password`, and `--ca-certs`, respectively.

To change the repository config from the command line, use the [`pdm config`](../reference/cli.md#exec-0--config) command:
To change the repository config from the command line, use the [`pdm config`](../reference/cli.md#config) command:

```bash
pdm config repository.pypi.username "__token__"
Expand Down
16 changes: 8 additions & 8 deletions docs/docs/usage/dependency.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following examples are run on Ubuntu 18.04, a few changes must be done if yo

## Add dependencies

[`pdm add`](../reference/cli.md#exec-0--add) can be followed by one or several dependencies, and the dependency specification is described in [PEP 508](https://www.python.org/dev/peps/pep-0508/).
[`pdm add`](../reference/cli.md#add) can be followed by one or several dependencies, and the dependency specification is described in [PEP 508](https://www.python.org/dev/peps/pep-0508/).

Examples:

Expand Down Expand Up @@ -166,7 +166,7 @@ for the dependency):

### Add prereleases

One can give `--pre/--prerelease` option to [`pdm add`](../reference/cli.md#exec-0--add) so that prereleases are allowed to be pinned for the given packages.
One can give `--pre/--prerelease` option to [`pdm add`](../reference/cli.md#add) so that prereleases are allowed to be pinned for the given packages.

## Update existing dependencies

Expand Down Expand Up @@ -223,7 +223,7 @@ which is given by `--update-<strategy>` option:
### Update packages to the versions that break the version specifiers

One can give `-u/--unconstrained` to tell PDM to ignore the version specifiers in the `pyproject.toml`.
This works similarly to the `yarn upgrade -L/--latest` command. Besides, [`pdm update`](../reference/cli.md#exec-0--update) also supports the
This works similarly to the `yarn upgrade -L/--latest` command. Besides, [`pdm update`](../reference/cli.md#update) also supports the
`--pre/--prerelease` option.

## Remove existing dependencies
Expand All @@ -243,9 +243,9 @@ pdm remove -dG test pytest-cov

There are a few similar commands to do this job with slight differences:

- [`pdm sync`](../reference/cli.md#exec-0--sync) installs packages from the lock file.
- [`pdm update`](../reference/cli.md#exec-0--update) will update the lock file, then `sync`.
- [`pdm install`](../reference/cli.md#exec-0--install) will check the project file for changes, update the lock file if needed, then `sync`.
- [`pdm sync`](../reference/cli.md#sync) installs packages from the lock file.
- [`pdm update`](../reference/cli.md#update) will update the lock file, then `sync`.
- [`pdm install`](../reference/cli.md#install) will check the project file for changes, update the lock file if needed, then `sync`.

`sync` also has a few options to manage installed packages:

Expand All @@ -254,7 +254,7 @@ There are a few similar commands to do this job with slight differences:

## Specify the lockfile to use

You can specify another lockfile than the default [`pdm lock`](../reference/cli.md#exec-0--lock) by using the `-L/--lockfile <filepath>` option or the `PDM_LOCKFILE` environment variable.
You can specify another lockfile than the default [`pdm lock`](../reference/cli.md#lock) by using the `-L/--lockfile <filepath>` option or the `PDM_LOCKFILE` environment variable.

## Select a subset of dependency groups to be installed or locked

Expand Down Expand Up @@ -406,7 +406,7 @@ project path via `-p/--project <path>` option.

## Export locked packages to alternative formats

You can also export [`pdm lock`](../reference/cli.md#exec-0--lock) to other formats, to ease the CI flow or image building process. Currently,
You can also export [`pdm lock`](../reference/cli.md#lock) to other formats, to ease the CI flow or image building process. Currently,
only `requirements.txt` format is supported:

```bash
Expand Down
20 changes: 10 additions & 10 deletions docs/docs/usage/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To provides full flexibility, PDM allows to [skip some hooks and tasks](#skippin

## Initialization

The initialization phase should occur only once in a project lifetime by running the [`pdm init`](../reference/cli.md#exec-0--init)
The initialization phase should occur only once in a project lifetime by running the [`pdm init`](../reference/cli.md#init)
command to initialize an existing project (prompt to fill the `pyproject.toml` file).

They trigger the following hooks:
Expand All @@ -50,12 +50,12 @@ The dependencies management is required for the developer to be able to work and

All those steps are directly available with the following commands:

- [`pdm lock`](../reference/cli.md#exec-0--lock): execute the `lock` task
- [`pdm sync`](../reference/cli.md#exec-0--sync): execute the `sync` task
- [`pdm install`](../reference/cli.md#exec-0--install): execute the `sync` task, preceded from `lock` if required
- [`pdm add`](../reference/cli.md#exec-0--add): add a dependency requirement, re-lock and then sync
- [`pdm remove`](../reference/cli.md#exec-0--remove): remove a dependency requirement, re-lock and then sync
- [`pdm update`](../reference/cli.md#exec-0--update): re-lock dependencies from their latest versions and then sync
- [`pdm lock`](../reference/cli.md#lock): execute the `lock` task
- [`pdm sync`](../reference/cli.md#sync): execute the `sync` task
- [`pdm install`](../reference/cli.md#install): execute the `sync` task, preceded from `lock` if required
- [`pdm add`](../reference/cli.md#add): add a dependency requirement, re-lock and then sync
- [`pdm remove`](../reference/cli.md#remove): remove a dependency requirement, re-lock and then sync
- [`pdm update`](../reference/cli.md#update): re-lock dependencies from their latest versions and then sync

They trigger the following hooks:

Expand Down Expand Up @@ -90,7 +90,7 @@ flowchart LR
### Switching Python version

This is a special case in dependency management:
you can switch the current Python version using [`pdm use`](../reference/cli.md#exec-0--use)
you can switch the current Python version using [`pdm use`](../reference/cli.md#use)
and it will emit the [`post_use`][pdm.signals.post_use] signal with the new Python interpreter.

```mermaid
Expand All @@ -111,8 +111,8 @@ As soon as you are ready to publish your package/library, you will require the p

All those steps are available with the following commands:

- [`pdm build`](../reference/cli.md#exec-0--build)
- [`pdm publish`](../reference/cli.md#exec-0--publish)
- [`pdm build`](../reference/cli.md#build)
- [`pdm publish`](../reference/cli.md#publish)

They trigger the following hooks:

Expand Down
3 changes: 3 additions & 0 deletions docs/docs/usage/pep582.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Working with PEP 582

!!! warning "PEP 582 has been rejected"
This is a rejected PEP. However, due to the fact that this feature is the reason for PDM's birth, PDM will retain the support.
We recommend using [virtual environments](./venv.md) instead.

With [PEP 582](https://www.python.org/dev/peps/pep-0582/), dependencies will be installed into `__pypackages__` directory under the project root. With [PEP 582 enabled globally](#enable-pep-582-globally), you can also use the project interpreter to run scripts directly.

Expand Down
Loading

0 comments on commit 8ce8602

Please sign in to comment.