Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
e3642300
P
Pdm
项目概览
后端镜像
/
Pdm
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pdm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e3642300
编写于
7月 08, 2022
作者:
F
Frost Ming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: respect `--prerelease` in the install script
上级
dcb68ab6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
9 deletion
+17
-9
README.md
README.md
+1
-1
README_zh.md
README_zh.md
+1
-1
docs/docs/index.md
docs/docs/index.md
+1
-1
install-pdm.py
install-pdm.py
+14
-6
未找到文件。
README.md
浏览文件 @
e3642300
...
...
@@ -92,7 +92,7 @@ curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py
```
For security reasons, you should verify the checksum of
`install-pdm.py`
.
The sha256 checksum is:
`
5efebd44f477521d0d8ef0e118b7e5765ff20f80d3d4dd9394f1b8ff1094fb4d
`
The sha256 checksum is:
`
f09accb8a530315be312cf9ce7af987ccb608aa90d3972968d73e7ef7d8c547b
`
The installer will install PDM into the user site and the location depends on the system:
...
...
README_zh.md
浏览文件 @
e3642300
...
...
@@ -87,7 +87,7 @@ curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py
```
为安全起见,你应该检查
`install-pdm.py`
文件的正确性。
SHA256 校验和:
`
5efebd44f477521d0d8ef0e118b7e5765ff20f80d3d4dd9394f1b8ff1094fb4d
`
SHA256 校验和:
`
f09accb8a530315be312cf9ce7af987ccb608aa90d3972968d73e7ef7d8c547b
`
默认情况下,此脚本会将 PDM 安装在 Python 的用户目录下,具体位置取决于当前系统:
...
...
docs/docs/index.md
浏览文件 @
e3642300
...
...
@@ -50,7 +50,7 @@ Like Pip, PDM provides an installation script that will install PDM into an isol
```
For security reasons, you should verify the checksum of
`install-pdm.py`
.
The sha256 checksum is:
`
5efebd44f477521d0d8ef0e118b7e5765ff20f80d3d4dd9394f1b8ff1094fb4d
`
The sha256 checksum is:
`
f09accb8a530315be312cf9ce7af987ccb608aa90d3972968d73e7ef7d8c547b
`
The installer will install PDM into the user site and the location depends on the system:
...
...
install-pdm.py
浏览文件 @
e3642300
...
...
@@ -6,6 +6,7 @@ import io
import
json
import
os
import
platform
import
re
import
shutil
import
site
import
subprocess
...
...
@@ -207,14 +208,23 @@ class Installer:
resp
=
urllib
.
request
.
urlopen
(
JSON_URL
)
metadata
=
json
.
load
(
resp
)
def
is_stable
(
v
:
str
)
->
bool
:
return
all
(
p
.
isdigit
()
for
p
in
v
.
split
(
"."
))
def
version_okay
(
v
:
str
)
->
bool
:
return
self
.
prerelease
or
all
(
p
.
isdigit
()
for
p
in
v
.
split
(
"."
))
def
sort_version
(
v
:
str
)
->
tuple
:
return
tuple
(
int
(
p
)
for
p
in
v
.
split
(
"."
))
parts
=
[]
for
part
in
v
.
split
(
"."
):
if
part
.
isdigit
():
parts
.
append
(
int
(
part
))
else
:
digit
,
rest
=
re
.
match
(
r
"^(\d*)(.*)"
,
part
).
groups
()
if
digit
:
parts
.
append
(
int
(
digit
))
parts
.
append
(
rest
)
return
tuple
(
parts
)
releases
=
sorted
(
filter
(
is_stable
,
metadata
[
"releases"
]),
key
=
sort_version
,
reverse
=
True
filter
(
version_okay
,
metadata
[
"releases"
]),
key
=
sort_version
,
reverse
=
True
)
return
releases
[
0
]
...
...
@@ -300,8 +310,6 @@ class Installer:
else
:
req
=
"pdm"
args
=
[
req
]
+
[
d
for
d
in
self
.
additional_deps
if
d
]
if
self
.
prerelease
:
args
.
insert
(
0
,
"--pre"
)
pip_cmd
=
[
str
(
venv_python
),
"-m"
,
"pip"
,
"install"
]
+
args
_call_subprocess
(
pip_cmd
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录