Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
0c5721fe
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,发现更多精彩内容 >>
提交
0c5721fe
编写于
9月 02, 2019
作者:
C
Chris Hunt
提交者:
Xavier Fernandez
9月 05, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplify directory delete marker file check.
上级
0f3a1c0b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
6 deletion
+14
-6
src/pip/_internal/req/req_install.py
src/pip/_internal/req/req_install.py
+5
-3
src/pip/_internal/utils/marker_files.py
src/pip/_internal/utils/marker_files.py
+4
-0
src/pip/_internal/wheel.py
src/pip/_internal/wheel.py
+5
-3
未找到文件。
src/pip/_internal/req/req_install.py
浏览文件 @
0c5721fe
...
...
@@ -28,7 +28,10 @@ from pip._internal.req.req_uninstall import UninstallPathSet
from
pip._internal.utils.compat
import
native_str
from
pip._internal.utils.hashes
import
Hashes
from
pip._internal.utils.logging
import
indent_log
from
pip._internal.utils.marker_files
import
PIP_DELETE_MARKER_FILENAME
from
pip._internal.utils.marker_files
import
(
PIP_DELETE_MARKER_FILENAME
,
has_delete_marker_file
,
)
from
pip._internal.utils.misc
import
(
_make_build_dir
,
ask_path_exists
,
...
...
@@ -399,8 +402,7 @@ class InstallRequirement(object):
# type: () -> None
"""Remove the source files from this requirement, if they are marked
for deletion"""
if
self
.
source_dir
and
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
source_dir
,
PIP_DELETE_MARKER_FILENAME
)):
if
self
.
source_dir
and
has_delete_marker_file
(
self
.
source_dir
):
logger
.
debug
(
'Removing source in %s'
,
self
.
source_dir
)
rmtree
(
self
.
source_dir
)
self
.
source_dir
=
None
...
...
src/pip/_internal/utils/marker_files.py
浏览文件 @
0c5721fe
...
...
@@ -10,6 +10,10 @@ deleted (unless you remove this file).
PIP_DELETE_MARKER_FILENAME
=
'pip-delete-this-directory.txt'
def
has_delete_marker_file
(
directory
):
return
os
.
path
.
exists
(
os
.
path
.
join
(
directory
,
PIP_DELETE_MARKER_FILENAME
))
def
write_delete_marker_file
(
directory
):
# type: (str) -> None
"""
...
...
src/pip/_internal/wheel.py
浏览文件 @
0c5721fe
...
...
@@ -36,7 +36,7 @@ from pip._internal.exceptions import (
from
pip._internal.locations
import
distutils_scheme
,
get_major_minor_version
from
pip._internal.models.link
import
Link
from
pip._internal.utils.logging
import
indent_log
from
pip._internal.utils.marker_files
import
PIP_DELETE_MARKER_FILENAME
from
pip._internal.utils.marker_files
import
has_delete_marker_file
from
pip._internal.utils.misc
import
(
LOG_DIVIDER
,
call_subprocess
,
...
...
@@ -1131,8 +1131,10 @@ class WheelBuilder(object):
# method.
# The code below assumes temporary source dirs -
# prevent it doing bad things.
if
req
.
source_dir
and
not
os
.
path
.
exists
(
os
.
path
.
join
(
req
.
source_dir
,
PIP_DELETE_MARKER_FILENAME
)):
if
(
req
.
source_dir
and
not
has_delete_marker_file
(
req
.
source_dir
)
):
raise
AssertionError
(
"bad source dir - missing marker"
)
# Delete the source we built the wheel from
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录