Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
29e03098
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,发现更多精彩内容 >>
未验证
提交
29e03098
编写于
3月 23, 2020
作者:
F
Frost Ming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix failed testing
上级
6bd87ee9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
8 deletion
+14
-8
pdm/cli/actions.py
pdm/cli/actions.py
+2
-4
pdm/iostream.py
pdm/iostream.py
+6
-0
tests/resolver/test_resolve.py
tests/resolver/test_resolve.py
+6
-4
未找到文件。
pdm/cli/actions.py
浏览文件 @
29e03098
...
...
@@ -4,7 +4,6 @@ from pathlib import Path
from
typing
import
Dict
,
Iterable
,
Optional
,
Sequence
import
click
import
halo
import
pythonfinder
import
tomlkit
from
pkg_resources
import
safe_name
...
...
@@ -48,9 +47,8 @@ def do_lock(
provider
=
project
.
get_provider
(
strategy
,
tracked_names
)
requirements
=
requirements
or
project
.
all_dependencies
# TODO: switch reporter at io level.
with
halo
.
Halo
(
text
=
"Resolving dependencies"
,
spinner
=
"dots"
with
stream
.
open_spinner
(
title
=
"Resolving dependencies"
,
spinner
=
"dots"
)
as
spin
,
stream
.
logging
(
"lock"
):
reporter
=
project
.
get_reporter
(
requirements
,
tracked_names
,
spin
)
resolver
=
project
.
core
.
resolver_class
(
provider
,
reporter
)
...
...
pdm/iostream.py
浏览文件 @
29e03098
...
...
@@ -8,6 +8,7 @@ from tempfile import mktemp
from
typing
import
List
,
Optional
import
click
import
halo
COLORS
=
(
"red"
,
"green"
,
"yellow"
,
"blue"
,
"black"
,
"magenta"
,
"cyan"
,
"white"
)
...
...
@@ -106,5 +107,10 @@ class IOStream:
except
OSError
:
pass
@
contextlib
.
contextmanager
def
open_spinner
(
self
,
title
:
str
,
spinner
:
str
=
"dots"
):
with
halo
.
Halo
(
title
,
spinner
=
spinner
)
as
spin
:
yield
spin
stream
=
IOStream
()
tests/resolver/test_resolve.py
浏览文件 @
29e03098
...
...
@@ -3,6 +3,7 @@ import itertools
import
pytest
from
pdm.exceptions
import
NoVersionsAvailable
,
ResolutionImpossible
from
pdm.iostream
import
stream
from
pdm.models.candidates
import
identify
from
pdm.models.requirements
import
parse_requirement
from
pdm.models.specifiers
import
PySpecSet
...
...
@@ -11,7 +12,7 @@ from pdm.resolver import (
EagerUpdateProvider
,
Resolver
,
ReusePinProvider
,
S
imple
Reporter
,
S
pinner
Reporter
,
resolve
,
)
from
tests
import
FIXTURES
...
...
@@ -50,9 +51,10 @@ def resolve_requirements(
flat_reqs
=
list
(
itertools
.
chain
(
*
[
deps
.
values
()
for
_
,
deps
in
requirements
.
items
()])
)
reporter
=
SimpleReporter
(
flat_reqs
)
resolver
=
Resolver
(
provider
,
reporter
)
mapping
,
*
_
=
resolve
(
resolver
,
requirements
,
requires_python
)
with
stream
.
open_spinner
(
"Resolving dependencies"
)
as
spin
:
reporter
=
SpinnerReporter
(
spin
,
flat_reqs
)
resolver
=
Resolver
(
provider
,
reporter
)
mapping
,
*
_
=
resolve
(
resolver
,
requirements
,
requires_python
)
return
mapping
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录