Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
f887aa6a
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,发现更多精彩内容 >>
提交
f887aa6a
编写于
3月 16, 2012
作者:
C
Carl Meyer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix upgrade of VCS requirement with otherwise nonexistent egg. Fixes #486.
上级
417fae49
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
1 deletion
+20
-1
docs/news.txt
docs/news.txt
+3
-0
pip/req.py
pip/req.py
+7
-1
tests/test_upgrade.py
tests/test_upgrade.py
+10
-0
未找到文件。
docs/news.txt
浏览文件 @
f887aa6a
...
...
@@ -13,6 +13,9 @@ Beta and final releases planned for the second half of 2012.
master (unreleased)
-------------------
* Fixed issue #486 - fix upgrade from VCS url of otherwise nonexistent egg.
Thanks aknapp for the report.
* Fixed issue #427 - clearer error message on a malformed VCS url. Thanks
Thomas Fenzl.
...
...
pip/req.py
浏览文件 @
f887aa6a
...
...
@@ -7,7 +7,8 @@ import pkg_resources
import
tempfile
from
pip.locations
import
bin_py
,
running_under_virtualenv
from
pip.exceptions
import
(
InstallationError
,
UninstallationError
,
BestVersionAlreadyInstalled
)
BestVersionAlreadyInstalled
,
DistributionNotFound
)
from
pip.vcs
import
vcs
from
pip.log
import
logger
from
pip.util
import
display_path
,
rmtree
...
...
@@ -910,6 +911,7 @@ class RequirementSet(object):
req_to_install
=
reqs
.
pop
(
0
)
install
=
True
best_installed
=
False
not_found
=
None
if
not
self
.
ignore_installed
and
not
req_to_install
.
editable
:
req_to_install
.
check_if_exists
()
if
req_to_install
.
satisfied_by
:
...
...
@@ -921,6 +923,8 @@ class RequirementSet(object):
except
BestVersionAlreadyInstalled
:
best_installed
=
True
install
=
False
except
DistributionNotFound
:
not_found
=
sys
.
exc_info
()[
1
]
else
:
# Avoid the need to call find_requirement again
req_to_install
.
url
=
url
.
url
...
...
@@ -975,6 +979,8 @@ class RequirementSet(object):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
location
,
'setup.py'
)):
## FIXME: this won't upgrade when there's an existing package unpacked in `location`
if
req_to_install
.
url
is
None
:
if
not_found
:
raise
not_found
url
=
finder
.
find_requirement
(
req_to_install
,
upgrade
=
self
.
upgrade
)
else
:
## FIXME: should req_to_install.url already be a link?
...
...
tests/test_upgrade.py
浏览文件 @
f887aa6a
...
...
@@ -3,6 +3,7 @@ from os.path import join
from
tests.test_pip
import
(
here
,
reset_env
,
run_pip
,
assert_all_changes
,
write_file
,
pyversion
,
_create_test_package
,
_change_test_package_version
)
from
tests.local_repos
import
local_checkout
def
test_no_upgrade_unless_requested
():
...
...
@@ -190,3 +191,12 @@ def test_install_with_ignoreinstalled_requested():
assert
result
.
files_created
,
'pip install -I did not install'
assert
env
.
site_packages
/
'INITools-0.1-py%s.egg-info'
%
pyversion
not
in
result
.
files_created
def
test_upgrade_vcs_req_with_no_dists_found
():
"""It can upgrade a VCS requirement that has no distributions otherwise."""
reset_env
()
req
=
"%s#egg=pip-test-package"
%
local_checkout
(
"git+http://github.com/pypa/pip-test-package.git"
)
run_pip
(
"install"
,
req
)
result
=
run_pip
(
"install"
,
"-U"
,
req
)
assert
not
result
.
returncode
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录