Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
2634beb2
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,发现更多精彩内容 >>
未验证
提交
2634beb2
编写于
3月 20, 2018
作者:
P
Paul Moore
提交者:
GitHub
3月 20, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5090 from philpennock/master
Keep install options in requirements.txt from leaking
上级
8dbdb74a
cb529e67
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
3 deletion
+40
-3
news/3763.bugfix
news/3763.bugfix
+1
-0
src/pip/_internal/req/req_install.py
src/pip/_internal/req/req_install.py
+5
-3
tests/functional/test_install_reqs.py
tests/functional/test_install_reqs.py
+34
-0
未找到文件。
news/3763.bugfix
0 → 100644
浏览文件 @
2634beb2
Keep install options in requirements.txt from leaking.
src/pip/_internal/req/req_install.py
浏览文件 @
2634beb2
...
...
@@ -771,11 +771,13 @@ class InstallRequirement(object):
# Options specified in requirements file override those
# specified on the command line, since the last option given
# to setup.py is the one that is used.
global_options
+=
self
.
options
.
get
(
'global_options'
,
[])
install_options
+=
self
.
options
.
get
(
'install_options'
,
[])
global_options
=
list
(
global_options
)
+
\
self
.
options
.
get
(
'global_options'
,
[])
install_options
=
list
(
install_options
)
+
\
self
.
options
.
get
(
'install_options'
,
[])
if
self
.
isolated
:
global_options
=
list
(
global_options
)
+
[
"--no-user-cfg"
]
global_options
=
global_options
+
[
"--no-user-cfg"
]
with
TempDirectory
(
kind
=
"record"
)
as
temp_dir
:
record_filename
=
os
.
path
.
join
(
temp_dir
.
path
,
'install-record.txt'
)
...
...
tests/functional/test_install_reqs.py
浏览文件 @
2634beb2
...
...
@@ -513,3 +513,37 @@ def test_install_unsupported_wheel_file(script, data):
assert
(
"simple.dist-0.1-py1-none-invalid.whl is not a supported "
+
"wheel on this platform"
in
result
.
stderr
)
assert
len
(
result
.
files_created
)
==
0
def
test_install_options_local_to_package
(
script
,
data
):
"""Make sure --install-options does not leak across packages.
A requirements.txt file can have per-package --install-options; these
should be isolated to just the package instead of leaking to subsequent
packages. This needs to be a functional test because the bug was around
cross-contamination at install time.
"""
home_simple
=
script
.
scratch_path
.
join
(
"for-simple"
)
test_simple
=
script
.
scratch
.
join
(
"for-simple"
)
home_simple
.
mkdir
()
reqs_file
=
script
.
scratch_path
.
join
(
"reqs.txt"
)
reqs_file
.
write
(
textwrap
.
dedent
(
"""
simple --install-option='--home=%s'
INITools
"""
%
home_simple
))
result
=
script
.
pip
(
'install'
,
'--no-index'
,
'-f'
,
data
.
find_links
,
'-r'
,
reqs_file
,
expect_error
=
True
,
)
simple
=
test_simple
/
'lib'
/
'python'
/
'simple'
bad
=
test_simple
/
'lib'
/
'python'
/
'initools'
good
=
script
.
site_packages
/
'initools'
assert
simple
in
result
.
files_created
assert
result
.
files_created
[
simple
].
dir
assert
bad
not
in
result
.
files_created
assert
good
in
result
.
files_created
assert
result
.
files_created
[
good
].
dir
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录