Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
bf2b63dd
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf2b63dd
编写于
6月 11, 2020
作者:
P
Paul Moore
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify tests to check unsupported forms of constraint in the new resolver
上级
4c055378
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
68 addition
and
32 deletion
+68
-32
tests/functional/test_install_reqs.py
tests/functional/test_install_reqs.py
+68
-32
未找到文件。
tests/functional/test_install_reqs.py
浏览文件 @
bf2b63dd
...
...
@@ -332,40 +332,56 @@ def test_constraints_local_install_causes_error(script, data):
assert
'Could not satisfy constraints for'
in
result
.
stderr
@
pytest
.
mark
.
fails_on_new_resolver
def
test_constraints_constrain_to_local_editable
(
script
,
data
):
def
test_constraints_constrain_to_local_editable
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
src
.
joinpath
(
"singlemodule"
)
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
"-e {url}#egg=singlemodule"
.
format
(
url
=
path_to_url
(
to_install
))
)
result
=
script
.
pip
(
'install'
,
'--no-index'
,
'-f'
,
data
.
find_links
,
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'singlemodule'
)
assert
'Running setup.py develop for singlemodule'
in
result
.
stdout
script
.
scratch_path
/
'constraints.txt'
,
'singlemodule'
,
expect_error
=
use_new_resolver
)
if
use_new_resolver
:
assert
'Links are not allowed as constraints'
in
result
.
stderr
else
:
assert
'Running setup.py develop for singlemodule'
in
result
.
stdout
@
pytest
.
mark
.
fails_on_new_resolver
def
test_constraints_constrain_to_local
(
script
,
data
):
def
test_constraints_constrain_to_local
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
src
.
joinpath
(
"singlemodule"
)
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
"{url}#egg=singlemodule"
.
format
(
url
=
path_to_url
(
to_install
))
)
result
=
script
.
pip
(
'install'
,
'--no-index'
,
'-f'
,
data
.
find_links
,
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'singlemodule'
)
assert
'Running setup.py install for singlemodule'
in
result
.
stdout
script
.
scratch_path
/
'constraints.txt'
,
'singlemodule'
,
expect_error
=
use_new_resolver
)
if
use_new_resolver
:
assert
'Links are not allowed as constraints'
in
result
.
stderr
else
:
assert
'Running setup.py install for singlemodule'
in
result
.
stdout
@
pytest
.
mark
.
fails_on_new_resolver
def
test_constrained_to_url_install_same_url
(
script
,
data
):
def
test_constrained_to_url_install_same_url
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
src
.
joinpath
(
"singlemodule"
)
constraints
=
path_to_url
(
to_install
)
+
"#egg=singlemodule"
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
constraints
)
result
=
script
.
pip
(
'install'
,
'--no-index'
,
'-f'
,
data
.
find_links
,
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
to_install
)
assert
(
'Running setup.py install for singlemodule'
in
result
.
stdout
),
str
(
result
)
script
.
scratch_path
/
'constraints.txt'
,
to_install
,
expect_error
=
use_new_resolver
)
if
use_new_resolver
:
assert
'Links are not allowed as constraints'
in
result
.
stderr
else
:
assert
(
'Running setup.py install for singlemodule'
in
result
.
stdout
),
str
(
result
)
def
test_double_install_spurious_hash_mismatch
(
...
...
@@ -402,15 +418,19 @@ def test_double_install_spurious_hash_mismatch(
assert
'Successfully installed simple-1.0'
in
str
(
result
)
@
pytest
.
mark
.
fails_on_new_resolver
def
test_install_with_extras_from_constraints
(
script
,
data
):
def
test_install_with_extras_from_constraints
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
packages
.
joinpath
(
"LocalExtras"
)
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
"{url}#egg=LocalExtras[bar]"
.
format
(
url
=
path_to_url
(
to_install
))
)
result
=
script
.
pip_install_local
(
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'LocalExtras'
)
result
.
did_create
(
script
.
site_packages
/
'simple'
)
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'LocalExtras'
,
expect_error
=
use_new_resolver
)
if
use_new_resolver
:
assert
'Links are not allowed as constraints'
in
result
.
stderr
else
:
result
.
did_create
(
script
.
site_packages
/
'simple'
)
def
test_install_with_extras_from_install
(
script
):
...
...
@@ -429,29 +449,36 @@ def test_install_with_extras_from_install(script):
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
@
pytest
.
mark
.
fails_on_new_resolver
def
test_install_with_extras_joined
(
script
,
data
):
def
test_install_with_extras_joined
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
packages
.
joinpath
(
"LocalExtras"
)
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
"{url}#egg=LocalExtras[bar]"
.
format
(
url
=
path_to_url
(
to_install
))
)
result
=
script
.
pip_install_local
(
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'LocalExtras[baz]'
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'LocalExtras[baz]'
,
expect_error
=
use_new_resolver
)
result
.
did_create
(
script
.
site_packages
/
'simple'
)
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
if
use_new_resolver
:
assert
'Links are not allowed as constraints'
in
result
.
stderr
else
:
result
.
did_create
(
script
.
site_packages
/
'simple'
)
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
@
pytest
.
mark
.
fails_on_new_resolver
def
test_install_with_extras_editable_joined
(
script
,
data
):
def
test_install_with_extras_editable_joined
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
packages
.
joinpath
(
"LocalExtras"
)
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
"-e {url}#egg=LocalExtras[bar]"
.
format
(
url
=
path_to_url
(
to_install
))
)
result
=
script
.
pip_install_local
(
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'LocalExtras[baz]'
)
result
.
did_create
(
script
.
site_packages
/
'simple'
)
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
'LocalExtras[baz]'
,
expect_error
=
use_new_resolver
)
if
use_new_resolver
:
assert
'Links are not allowed as constraints'
in
result
.
stderr
else
:
result
.
did_create
(
script
.
site_packages
/
'simple'
)
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
def
test_install_distribution_full_union
(
script
,
data
):
...
...
@@ -473,15 +500,24 @@ def test_install_distribution_duplicate_extras(script, data):
assert
expected
in
result
.
stderr
@
pytest
.
mark
.
fails_on_new_resolver
def
test_install_distribution_union_with_constraints
(
script
,
data
):
def
test_install_distribution_union_with_constraints
(
script
,
data
,
use_new_resolver
):
to_install
=
data
.
packages
.
joinpath
(
"LocalExtras"
)
script
.
scratch_path
.
joinpath
(
"constraints.txt"
).
write_text
(
"{to_install}[bar]"
.
format
(
**
locals
()))
result
=
script
.
pip_install_local
(
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
to_install
+
'[baz]'
)
assert
'Running setup.py install for LocalExtras'
in
result
.
stdout
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
'-c'
,
script
.
scratch_path
/
'constraints.txt'
,
to_install
+
'[baz]'
,
expect_error
=
use_new_resolver
)
if
use_new_resolver
:
msg
=
'Unnamed requirements are not allowed as constraints'
assert
msg
in
result
.
stderr
else
:
assert
'Running setup.py install for LocalExtras'
in
result
.
stdout
result
.
did_create
(
script
.
site_packages
/
'singlemodule.py'
)
@
pytest
.
mark
.
fails_on_new_resolver
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录