Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
a88bc0de
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,发现更多精彩内容 >>
提交
a88bc0de
编写于
3月 16, 2015
作者:
D
Donald Stufft
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Send log messages >= logging.WARNING to stderr
上级
f82d033b
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
67 addition
and
27 deletion
+67
-27
CHANGES.txt
CHANGES.txt
+2
-0
pip/basecommand.py
pip/basecommand.py
+16
-2
pip/commands/freeze.py
pip/commands/freeze.py
+1
-1
pip/utils/logging.py
pip/utils/logging.py
+9
-0
tests/functional/test_install.py
tests/functional/test_install.py
+9
-6
tests/functional/test_install_cleanup.py
tests/functional/test_install_cleanup.py
+8
-3
tests/functional/test_install_extras.py
tests/functional/test_install_extras.py
+3
-3
tests/functional/test_install_reqs.py
tests/functional/test_install_reqs.py
+1
-0
tests/functional/test_install_upgrade.py
tests/functional/test_install_upgrade.py
+2
-2
tests/functional/test_install_user.py
tests/functional/test_install_user.py
+3
-3
tests/functional/test_install_vcs.py
tests/functional/test_install_vcs.py
+2
-1
tests/functional/test_install_wheel.py
tests/functional/test_install_wheel.py
+4
-1
tests/functional/test_list.py
tests/functional/test_list.py
+3
-1
tests/functional/test_search.py
tests/functional/test_search.py
+1
-1
tests/functional/test_show.py
tests/functional/test_show.py
+1
-1
tests/functional/test_uninstall.py
tests/functional/test_uninstall.py
+1
-1
tests/functional/test_wheel.py
tests/functional/test_wheel.py
+1
-1
未找到文件。
CHANGES.txt
浏览文件 @
a88bc0de
...
...
@@ -41,6 +41,8 @@
* Support arch specific wheels that are not tied to a specific Python ABI.
(:pull:`2561`)
* Output warnings and errors to stderr instead of stdout. (:pull:`2543`)
**6.0.8 (2015-02-04)**
...
...
pip/basecommand.py
浏览文件 @
a88bc0de
...
...
@@ -38,7 +38,7 @@ class Command(object):
name
=
None
usage
=
None
hidden
=
False
log_stream
=
"ext://sys.stdout"
log_stream
s
=
(
"ext://sys.stdout"
,
"ext://sys.stderr"
)
def
__init__
(
self
,
isolated
=
False
):
parser_kw
=
{
...
...
@@ -124,6 +124,12 @@ class Command(object):
logging_dictConfig
({
"version"
:
1
,
"disable_existing_loggers"
:
False
,
"filters"
:
{
"exclude_warnings"
:
{
"()"
:
"pip.utils.logging.MaxLevelFilter"
,
"level"
:
logging
.
WARNING
,
},
},
"formatters"
:
{
"indent"
:
{
"()"
:
IndentingFormatter
,
...
...
@@ -138,7 +144,14 @@ class Command(object):
"console"
:
{
"level"
:
level
,
"class"
:
"pip.utils.logging.ColorizedStreamHandler"
,
"stream"
:
self
.
log_stream
,
"stream"
:
self
.
log_streams
[
0
],
"filters"
:
[
"exclude_warnings"
],
"formatter"
:
"indent"
,
},
"console_errors"
:
{
"level"
:
"WARNING"
,
"class"
:
"pip.utils.logging.ColorizedStreamHandler"
,
"stream"
:
self
.
log_streams
[
1
],
"formatter"
:
"indent"
,
},
"debug_log"
:
{
...
...
@@ -162,6 +175,7 @@ class Command(object):
"level"
:
level
,
"handlers"
:
list
(
filter
(
None
,
[
"console"
,
"console_errors"
,
"debug_log"
if
write_debug_log
else
None
,
"user_log"
if
options
.
log
else
None
,
])),
...
...
pip/commands/freeze.py
浏览文件 @
a88bc0de
...
...
@@ -16,7 +16,7 @@ class FreezeCommand(Command):
usage
=
"""
%prog [options]"""
summary
=
'Output installed packages in requirements format.'
log_stream
=
"ext://sys.stderr"
log_stream
s
=
(
"ext://sys.stderr"
,
"ext://sys.stderr"
)
def
__init__
(
self
,
*
args
,
**
kw
):
super
(
FreezeCommand
,
self
).
__init__
(
*
args
,
**
kw
)
...
...
pip/utils/logging.py
浏览文件 @
a88bc0de
...
...
@@ -119,3 +119,12 @@ class BetterRotatingFileHandler(logging.handlers.RotatingFileHandler):
os
.
makedirs
(
os
.
path
.
dirname
(
self
.
baseFilename
))
return
logging
.
handlers
.
RotatingFileHandler
.
_open
(
self
)
class
MaxLevelFilter
(
logging
.
Filter
):
def
__init__
(
self
,
level
):
self
.
level
=
level
def
filter
(
self
,
record
):
return
record
.
levelno
<
self
.
level
tests/functional/test_install.py
浏览文件 @
a88bc0de
...
...
@@ -27,7 +27,7 @@ def test_without_setuptools(script, data):
)
assert
(
"setuptools must be installed to install from a source distribution"
in
result
.
std
out
in
result
.
std
err
)
...
...
@@ -74,7 +74,7 @@ def test_editable_install(script):
result
=
script
.
pip
(
'install'
,
'-e'
,
'INITools==0.2'
,
expect_error
=
True
)
assert
(
"INITools==0.2 should either be a path to a local project or a VCS url"
in
result
.
std
out
in
result
.
std
err
)
assert
not
result
.
files_created
assert
not
result
.
files_updated
...
...
@@ -205,7 +205,7 @@ def test_bad_install_with_no_download(script):
)
assert
(
"perhaps --no-download was used without first running "
"an equivalent install with --no-install?"
in
result
.
std
out
"an equivalent install with --no-install?"
in
result
.
std
err
)
...
...
@@ -310,7 +310,7 @@ def test_install_from_local_directory_with_no_setup_py(script, data):
"""
result
=
script
.
pip
(
'install'
,
data
.
root
,
expect_error
=
True
)
assert
not
result
.
files_created
assert
"is not installable. File 'setup.py' not found."
in
result
.
std
out
assert
"is not installable. File 'setup.py' not found."
in
result
.
std
err
def
test_editable_install_from_local_directory_with_no_setup_py
(
script
,
data
):
...
...
@@ -319,7 +319,7 @@ def test_editable_install_from_local_directory_with_no_setup_py(script, data):
"""
result
=
script
.
pip
(
'install'
,
'-e'
,
data
.
root
,
expect_error
=
True
)
assert
not
result
.
files_created
assert
"is not installable. File 'setup.py' not found."
in
result
.
std
out
assert
"is not installable. File 'setup.py' not found."
in
result
.
std
err
def
test_install_as_egg
(
script
,
data
):
...
...
@@ -508,7 +508,9 @@ def test_install_package_with_target(script):
)
# Test repeated call without --upgrade, no files should have changed
result
=
script
.
pip_install_local
(
'-t'
,
target_dir
,
"simple==1.0"
)
result
=
script
.
pip_install_local
(
'-t'
,
target_dir
,
"simple==1.0"
,
expect_stderr
=
True
,
)
assert
not
Path
(
'scratch'
)
/
'target'
/
'simple'
in
result
.
files_updated
# Test upgrade call, check that new version is installed
...
...
@@ -658,6 +660,7 @@ def test_url_incorrect_case_file_index(script, data):
"""
result
=
script
.
pip
(
'install'
,
'--index-url'
,
data
.
find_links3
,
"dinner"
,
expect_stderr
=
True
,
)
# only Upper-2.0.tar.gz should get installed.
...
...
tests/functional/test_install_cleanup.py
浏览文件 @
a88bc0de
...
...
@@ -80,7 +80,9 @@ def test_no_install_and_download_should_not_leave_build_dir(script):
script
.
scratch_path
.
join
(
"downloaded_packages"
).
mkdir
()
assert
not
os
.
path
.
exists
(
script
.
venv_path
/
'build'
)
result
=
script
.
pip
(
'install'
,
'--no-install'
,
'INITools==0.2'
,
'-d'
,
'downloaded_packages'
'install'
,
'--no-install'
,
'INITools==0.2'
,
'-d'
,
'downloaded_packages'
,
expect_stderr
=
True
,
)
assert
(
Path
(
'scratch'
)
/
'downloaded_packages/build'
...
...
@@ -118,7 +120,10 @@ def test_download_should_not_delete_existing_build_dir(script):
"""
script
.
venv_path
.
join
(
"build"
).
mkdir
()
script
.
venv_path
.
join
(
"build"
,
"somefile.txt"
).
write
(
"I am not empty!"
)
script
.
pip
(
'install'
,
'--no-install'
,
'INITools==0.2'
,
'-d'
,
'.'
)
script
.
pip
(
'install'
,
'--no-install'
,
'INITools==0.2'
,
'-d'
,
'.'
,
expect_stderr
=
True
,
)
with
open
(
script
.
venv_path
/
'build'
/
'somefile.txt'
)
as
fp
:
content
=
fp
.
read
()
assert
os
.
path
.
exists
(
script
.
venv_path
/
'build'
),
(
...
...
@@ -175,5 +180,5 @@ def test_cleanup_prevented_upon_build_dir_exception(script, data):
)
assert
result
.
returncode
==
PREVIOUS_BUILD_DIR_ERROR
assert
"pip can't proceed"
in
result
.
std
out
,
result
.
stdout
assert
"pip can't proceed"
in
result
.
std
err
assert
exists
(
build_simple
)
tests/functional/test_install_extras.py
浏览文件 @
a88bc0de
...
...
@@ -67,7 +67,7 @@ def test_nonexistent_extra_warns_user_no_wheel(script, data):
)
assert
(
"simple 3.0 does not provide the extra 'nonexistent'"
in
result
.
std
out
in
result
.
std
err
)
...
...
@@ -85,7 +85,7 @@ def test_nonexistent_extra_warns_user_with_wheel(script, data):
)
assert
(
"simplewheel 2.0 does not provide the extra 'nonexistent'"
in
result
.
std
out
in
result
.
std
err
)
...
...
@@ -102,4 +102,4 @@ def test_nonexistent_options_listed_in_order(script, data):
" simplewheel 2.0 does not provide the extra 'nonexistent'
\n
"
" simplewheel 2.0 does not provide the extra 'nope'"
)
assert
msg
in
result
.
std
out
assert
msg
in
result
.
std
err
tests/functional/test_install_reqs.py
浏览文件 @
a88bc0de
...
...
@@ -137,6 +137,7 @@ def test_install_local_editable_with_extras(script, data):
res
=
script
.
pip
(
'install'
,
'-e'
,
to_install
+
'[bar]'
,
'--process-dependency-links'
,
expect_error
=
False
,
expect_stderr
=
True
,
)
assert
script
.
site_packages
/
'easy-install.pth'
in
res
.
files_updated
,
(
str
(
res
)
...
...
tests/functional/test_install_upgrade.py
浏览文件 @
a88bc0de
...
...
@@ -293,8 +293,8 @@ def test_upgrade_vcs_req_with_dist_found(script):
"743aad47656b27"
)
)
script
.
pip
(
"install"
,
req
)
result
=
script
.
pip
(
"install"
,
"-U"
,
req
)
script
.
pip
(
"install"
,
req
,
expect_stderr
=
True
)
result
=
script
.
pip
(
"install"
,
"-U"
,
req
,
expect_stderr
=
True
)
assert
"pypi.python.org"
not
in
result
.
stdout
,
result
.
stdout
...
...
tests/functional/test_install_user.py
浏览文件 @
a88bc0de
...
...
@@ -104,7 +104,7 @@ class Tests_UserSite:
)
assert
(
"Can not perform a '--user' install. User site-packages are not "
"visible in this virtualenv."
in
result
.
std
out
"visible in this virtualenv."
in
result
.
std
err
)
@
pytest
.
mark
.
network
...
...
@@ -288,5 +288,5 @@ class Tests_UserSite:
assert
(
"Will not install to the user site because it will lack sys.path "
"precedence to %s in %s"
%
(
'INITools'
,
dist_location
)
in
result2
.
std
out
)
,
result2
.
stdout
(
'INITools'
,
dist_location
)
in
result2
.
std
err
)
tests/functional/test_install_vcs.py
浏览文件 @
a88bc0de
...
...
@@ -56,7 +56,8 @@ def test_git_with_sha1_revisions(script):
script
.
pip
(
'install'
,
'-e'
,
'%s@%s#egg=version_pkg'
%
(
'git+file://'
+
version_pkg_path
.
abspath
.
replace
(
'
\\
'
,
'/'
),
sha1
)
(
'git+file://'
+
version_pkg_path
.
abspath
.
replace
(
'
\\
'
,
'/'
),
sha1
),
expect_stderr
=
True
)
version
=
script
.
run
(
'version_pkg'
)
assert
'0.1'
in
version
.
stdout
,
version
.
stdout
...
...
tests/functional/test_install_wheel.py
浏览文件 @
a88bc0de
...
...
@@ -17,7 +17,10 @@ def test_install_from_future_wheel_version(script, data):
editable
=
False
)
package
=
data
.
packages
.
join
(
"futurewheel-1.9-py2.py3-none-any.whl"
)
result
=
script
.
pip
(
'install'
,
package
,
'--no-index'
,
expect_error
=
False
)
result
=
script
.
pip
(
'install'
,
package
,
'--no-index'
,
expect_error
=
False
,
expect_stderr
=
True
,
)
result
.
assert_installed
(
'futurewheel'
,
without_egg_link
=
True
,
editable
=
False
)
...
...
tests/functional/test_list.py
浏览文件 @
a88bc0de
...
...
@@ -55,7 +55,8 @@ def test_uptodate_flag(script, data):
'git+https://github.com/pypa/pip-test-package.git#egg=pip-test-package'
)
result
=
script
.
pip
(
'list'
,
'-f'
,
data
.
find_links
,
'--no-index'
,
'--uptodate'
'list'
,
'-f'
,
data
.
find_links
,
'--no-index'
,
'--uptodate'
,
expect_stderr
=
True
,
)
assert
'simple (1.0)'
not
in
result
.
stdout
# 3.0 is latest
assert
'pip-test-package'
not
in
result
.
stdout
# editables excluded
...
...
@@ -78,6 +79,7 @@ def test_outdated_flag(script, data):
)
result
=
script
.
pip
(
'list'
,
'-f'
,
data
.
find_links
,
'--no-index'
,
'--outdated'
,
expect_stderr
=
True
,
)
assert
'simple (Current: 1.0 Latest: 3.0 [sdist])'
in
result
.
stdout
assert
'simplewheel (Current: 1.0 Latest: 2.0 [wheel])'
in
result
.
stdout
...
...
tests/functional/test_search.py
浏览文件 @
a88bc0de
...
...
@@ -129,7 +129,7 @@ def test_search_missing_argument(script):
Test missing required argument for search
"""
result
=
script
.
pip
(
'search'
,
expect_error
=
True
)
assert
'ERROR: Missing required argument (search query).'
in
result
.
std
out
assert
'ERROR: Missing required argument (search query).'
in
result
.
std
err
@
pytest
.
mark
.
network
...
...
tests/functional/test_show.py
浏览文件 @
a88bc0de
...
...
@@ -67,7 +67,7 @@ def test_missing_argument(script):
Test show command with no arguments.
"""
result
=
script
.
pip
(
'show'
,
expect_error
=
True
)
assert
'ERROR: Please provide a package name or names.'
in
result
.
std
out
assert
'ERROR: Please provide a package name or names.'
in
result
.
std
err
def
test_find_package_not_found
():
...
...
tests/functional/test_uninstall.py
浏览文件 @
a88bc0de
...
...
@@ -47,7 +47,7 @@ def test_simple_uninstall_distutils(script):
result
=
script
.
run
(
'python'
,
pkg_path
/
'setup.py'
,
'install'
)
result
=
script
.
pip
(
'list'
)
assert
"distutils-install (0.1)"
in
result
.
stdout
script
.
pip
(
'uninstall'
,
'distutils_install'
,
'-y'
)
script
.
pip
(
'uninstall'
,
'distutils_install'
,
'-y'
,
expect_stderr
=
True
)
result2
=
script
.
pip
(
'list'
)
assert
"distutils-install (0.1)"
not
in
result2
.
stdout
...
...
tests/functional/test_wheel.py
浏览文件 @
a88bc0de
...
...
@@ -17,7 +17,7 @@ def test_pip_wheel_fails_without_wheel(script, data):
'wheel'
,
'--no-index'
,
'-f'
,
data
.
find_links
,
'simple==3.0'
,
expect_error
=
True
,
)
assert
"'pip wheel' requires the 'wheel' package"
in
result
.
std
out
assert
"'pip wheel' requires the 'wheel' package"
in
result
.
std
err
@
pytest
.
mark
.
network
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录