mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
pypi: add help on pdm/poetry
Closes https://github.com/tuna/issues/issues/1646
This commit is contained in:
parent
e0011b6e2d
commit
5038749b49
|
|
@ -8,7 +8,9 @@ mirrorid: pypi
|
|||
|
||||
PyPI 镜像在每次同步成功后间隔 5 分钟同步一次。
|
||||
|
||||
### 临时使用
|
||||
### pip
|
||||
|
||||
#### 临时使用
|
||||
|
||||
```
|
||||
pip install -i https://{{ site.pypi }}/simple some-package
|
||||
|
|
@ -16,7 +18,7 @@ pip install -i https://{{ site.pypi }}/simple some-package
|
|||
|
||||
注意,`simple` 不能少, 是 `https` 而不是 `http`
|
||||
|
||||
### 设为默认
|
||||
#### 设为默认
|
||||
|
||||
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:
|
||||
|
||||
|
|
@ -31,7 +33,7 @@ pip config set global.index-url https://{{ site.pypi }}/simple
|
|||
python -m pip install -i https://{{ site.pypi }}/simple --upgrade pip
|
||||
```
|
||||
|
||||
### 配置多个镜像源
|
||||
#### 配置多个镜像源
|
||||
|
||||
如果您想配置多个镜像源平衡负载,可在已经替换 `index-url` 的情况下通过以下方式继续增加源站:
|
||||
|
||||
|
|
@ -42,3 +44,25 @@ pip config set global.extra-index-url "<url1> <url2>..."
|
|||
请自行替换引号内的内容,源地址之间需要有空格
|
||||
|
||||
可用的 `pypi` 源列表(校园网联合镜像站):<https://mirrors.cernet.edu.cn/list/pypi>
|
||||
|
||||
### PDM
|
||||
|
||||
通过如下命令设置默认镜像:
|
||||
|
||||
```
|
||||
pdm config pypi.url https://{{ site.pypi }}/simple
|
||||
```
|
||||
|
||||
### Poetry
|
||||
|
||||
通过以下命令设置默认镜像:
|
||||
|
||||
```
|
||||
poetry source add --default mirrors https://{{ site.pypi }}/simple/
|
||||
```
|
||||
|
||||
通过以下命令设置次级镜像:
|
||||
|
||||
```
|
||||
poetry source add --secondary mirrors https://{{ site.pypi }}/simple/
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue