Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
3dae23ee
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,发现更多精彩内容 >>
提交
3dae23ee
编写于
8月 27, 2009
作者:
B
Brian Rosner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added --no-deps/--no-dependencies option to ignore package dependencies
上级
795fac38
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
15 deletion
+27
-15
docs/news.txt
docs/news.txt
+2
-0
pip.py
pip.py
+25
-15
未找到文件。
docs/news.txt
浏览文件 @
3dae23ee
...
...
@@ -29,6 +29,8 @@ tip
* Reduced the amount of console log messages when fetching a page to find a
distribution was problematic. The full messages can be found in pip-log.txt.
* Added --no-deps/--no-dependencies option to ignore package dependencies
0.4
---
...
...
pip.py
浏览文件 @
3dae23ee
...
...
@@ -397,6 +397,13 @@ class InstallCommand(Command):
dest
=
'ignore_installed'
,
action
=
'store_true'
,
help
=
'Ignore the installed packages (reinstalling instead)'
)
self
.
parser
.
add_option
(
'--no-deps'
,
'--no-dependencies'
,
dest
=
'ignore_dependencies'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Ignore package dependencies'
,
)
self
.
parser
.
add_option
(
'--no-install'
,
dest
=
'no_install'
,
...
...
@@ -429,7 +436,8 @@ class InstallCommand(Command):
build_dir
=
options
.
build_dir
,
src_dir
=
options
.
src_dir
,
upgrade
=
options
.
upgrade
,
ignore_installed
=
options
.
ignore_installed
)
ignore_installed
=
options
.
ignore_installed
,
ignore_dependencies
=
options
.
ignore_dependencies
)
for
name
in
args
:
requirement_set
.
add_requirement
(
InstallRequirement
.
from_line
(
name
,
None
))
...
...
@@ -1812,7 +1820,7 @@ deleted (unless you remove this file).
class
RequirementSet
(
object
):
def
__init__
(
self
,
build_dir
,
src_dir
,
upgrade
=
False
,
ignore_installed
=
False
):
def
__init__
(
self
,
build_dir
,
src_dir
,
upgrade
=
False
,
ignore_installed
=
False
,
ignore_dependencies
=
False
):
self
.
build_dir
=
build_dir
self
.
src_dir
=
src_dir
self
.
upgrade
=
upgrade
...
...
@@ -1821,6 +1829,7 @@ class RequirementSet(object):
# Mapping of alias: real_name
self
.
requirement_aliases
=
{}
self
.
unnamed_requirements
=
[]
self
.
ignore_dependencies
=
ignore_dependencies
def
__str__
(
self
):
reqs
=
[
req
for
req
in
self
.
requirements
.
values
()
...
...
@@ -1944,19 +1953,20 @@ class RequirementSet(object):
## FIXME: shouldn't be globally added:
finder
.
add_dependency_links
(
req_to_install
.
dependency_links
)
## FIXME: add extras in here:
for
req
in
req_to_install
.
requirements
():
try
:
name
=
pkg_resources
.
Requirement
.
parse
(
req
).
project_name
except
ValueError
,
e
:
## FIXME: proper warning
logger
.
error
(
'Invalid requirement: %r (%s) in requirement %s'
%
(
req
,
e
,
req_to_install
))
continue
if
self
.
has_requirement
(
name
):
## FIXME: check for conflict
continue
subreq
=
InstallRequirement
(
req
,
req_to_install
)
reqs
.
append
(
subreq
)
self
.
add_requirement
(
subreq
)
if
not
self
.
ignore_dependencies
:
for
req
in
req_to_install
.
requirements
():
try
:
name
=
pkg_resources
.
Requirement
.
parse
(
req
).
project_name
except
ValueError
,
e
:
## FIXME: proper warning
logger
.
error
(
'Invalid requirement: %r (%s) in requirement %s'
%
(
req
,
e
,
req_to_install
))
continue
if
self
.
has_requirement
(
name
):
## FIXME: check for conflict
continue
subreq
=
InstallRequirement
(
req
,
req_to_install
)
reqs
.
append
(
subreq
)
self
.
add_requirement
(
subreq
)
if
req_to_install
.
name
not
in
self
.
requirements
:
self
.
requirements
[
req_to_install
.
name
]
=
req_to_install
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录