Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
64681084
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
64681084
编写于
4月 12, 2021
作者:
T
Tzu-ping Chung
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' into resolvelib-060
上级
4e56f1c5
a0f60416
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
66 addition
and
29 deletion
+66
-29
.github/workflows/ci.yml
.github/workflows/ci.yml
+1
-1
.readthedocs.yml
.readthedocs.yml
+1
-1
docs/html/user_guide.rst
docs/html/user_guide.rst
+1
-1
news/9409.bugfix.rst
news/9409.bugfix.rst
+2
-0
news/9779.bugfix.rst
news/9779.bugfix.rst
+1
-0
src/pip/__main__.py
src/pip/__main__.py
+9
-2
src/pip/_internal/cli/base_command.py
src/pip/_internal/cli/base_command.py
+1
-1
src/pip/_internal/cli/cmdoptions.py
src/pip/_internal/cli/cmdoptions.py
+10
-1
src/pip/_internal/commands/install.py
src/pip/_internal/commands/install.py
+5
-2
src/pip/_internal/commands/wheel.py
src/pip/_internal/commands/wheel.py
+2
-14
tests/functional/test_warning.py
tests/functional/test_warning.py
+5
-0
tests/lib/venv.py
tests/lib/venv.py
+11
-5
tests/unit/test_command_install.py
tests/unit/test_command_install.py
+3
-1
tests/unit/test_resolution_legacy_resolver.py
tests/unit/test_resolution_legacy_resolver.py
+12
-0
tools/requirements/docs.txt
tools/requirements/docs.txt
+2
-0
未找到文件。
.github/workflows/ci.yml
浏览文件 @
64681084
...
...
@@ -2,7 +2,7 @@ name: CI
on
:
push
:
branches
:
[
ma
ster
]
branches
:
[
ma
in
]
tags
:
# Tags for all potential release numbers till 2030.
-
"
2[0-9].[0-3]"
# 20.0 -> 29.3
...
...
.readthedocs.yml
浏览文件 @
64681084
...
...
@@ -5,6 +5,6 @@ sphinx:
configuration
:
docs/html/conf.py
python
:
version
:
3.
7
version
:
3.
8
install
:
-
requirements
:
tools/requirements/docs.txt
docs/html/user_guide.rst
浏览文件 @
64681084
...
...
@@ -1368,7 +1368,7 @@ When pip finds that an assumption is incorrect, it has to try another approach
(
backtrack
),
which
means
discarding
some
of
the
work
that
has
already
been
done
,
and
going
back
to
choose
another
path
.
For
example
;
The
user
requests
``
pip
install
tea
``.
``
`
tea
``
has
dependencies
of
For
example
;
The
user
requests
``
pip
install
tea
``.
``
tea
``
has
dependencies
of
``
cup
``,
``
hot
-
water
``,
``
spoon
``
amongst
others
.
pip
starts
by
installing
a
version
of
``
cup
``.
If
it
finds
out
it
isn
’
t
...
...
news/9409.bugfix.rst
0 → 100644
浏览文件 @
64681084
``--user`` is no longer suggested incorrectly when pip fails with a permission
error in a virtual environment.
news/9779.bugfix.rst
0 → 100644
浏览文件 @
64681084
Fix pip to work with warnings converted to errors.
src/pip/__main__.py
浏览文件 @
64681084
import
os
import
sys
import
warnings
# Remove '' and current working directory from the first entry
# of sys.path, if present to avoid using current directory
...
...
@@ -18,7 +19,13 @@ if __package__ == "":
path
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
sys
.
path
.
insert
(
0
,
path
)
from
pip._internal.cli.main
import
main
as
_main
if
__name__
==
"__main__"
:
# Work around the error reported in #9540, pending a proper fix.
# Note: It is essential the warning filter is set *before* importing
# pip, as the deprecation happens at import time, not runtime.
warnings
.
filterwarnings
(
"ignore"
,
category
=
DeprecationWarning
,
module
=
".*packaging
\\
.version"
)
from
pip._internal.cli.main
import
main
as
_main
sys
.
exit
(
_main
())
src/pip/_internal/cli/base_command.py
浏览文件 @
64681084
...
...
@@ -165,7 +165,7 @@ class Command(CommandContextMixIn):
"use the TMPDIR/TEMP/TMP environment variable, "
"possibly combined with --no-clean"
),
gone_in
=
"21.
1
"
,
gone_in
=
"21.
3
"
,
issue
=
8333
,
)
...
...
src/pip/_internal/cli/cmdoptions.py
浏览文件 @
64681084
...
...
@@ -824,6 +824,15 @@ install_options = partial(
"directory path, be sure to use absolute path."
,
)
# type: Callable[..., Option]
build_options
=
partial
(
Option
,
"--build-option"
,
dest
=
"build_options"
,
metavar
=
"options"
,
action
=
"append"
,
help
=
"Extra arguments to be supplied to 'setup.py bdist_wheel'."
,
)
# type: Callable[..., Option]
global_options
=
partial
(
Option
,
"--global-option"
,
...
...
@@ -831,7 +840,7 @@ global_options = partial(
action
=
"append"
,
metavar
=
"options"
,
help
=
"Extra global options to be supplied to the setup.py "
"call before the install command."
,
"call before the install
or bdist_wheel
command."
,
)
# type: Callable[..., Option]
no_clean
=
partial
(
...
...
src/pip/_internal/commands/install.py
浏览文件 @
64681084
...
...
@@ -35,7 +35,10 @@ from pip._internal.utils.misc import (
write_output
,
)
from
pip._internal.utils.temp_dir
import
TempDirectory
from
pip._internal.utils.virtualenv
import
virtualenv_no_global
from
pip._internal.utils.virtualenv
import
(
running_under_virtualenv
,
virtualenv_no_global
,
)
from
pip._internal.wheel_builder
import
(
BinaryAllowedPredicate
,
build
,
...
...
@@ -725,7 +728,7 @@ def create_os_error_message(error, show_traceback, using_user_site):
user_option_part
=
"Consider using the `--user` option"
permissions_part
=
"Check the permissions"
if
not
using_user_site
:
if
not
running_under_virtualenv
()
and
not
using_user_site
:
parts
.
extend
([
user_option_part
,
" or "
,
permissions_part
.
lower
(),
...
...
src/pip/_internal/commands/wheel.py
浏览文件 @
64681084
...
...
@@ -54,13 +54,6 @@ class WheelCommand(RequirementCommand):
self
.
cmd_opts
.
add_option
(
cmdoptions
.
no_binary
())
self
.
cmd_opts
.
add_option
(
cmdoptions
.
only_binary
())
self
.
cmd_opts
.
add_option
(
cmdoptions
.
prefer_binary
())
self
.
cmd_opts
.
add_option
(
'--build-option'
,
dest
=
'build_options'
,
metavar
=
'options'
,
action
=
'append'
,
help
=
"Extra arguments to be supplied to 'setup.py bdist_wheel'."
,
)
self
.
cmd_opts
.
add_option
(
cmdoptions
.
no_build_isolation
())
self
.
cmd_opts
.
add_option
(
cmdoptions
.
use_pep517
())
self
.
cmd_opts
.
add_option
(
cmdoptions
.
no_use_pep517
())
...
...
@@ -81,13 +74,8 @@ class WheelCommand(RequirementCommand):
help
=
"Don't verify if built wheel is valid."
,
)
self
.
cmd_opts
.
add_option
(
'--global-option'
,
dest
=
'global_options'
,
action
=
'append'
,
metavar
=
'options'
,
help
=
"Extra global options to be supplied to the setup.py "
"call before the 'bdist_wheel' command."
)
self
.
cmd_opts
.
add_option
(
cmdoptions
.
build_options
())
self
.
cmd_opts
.
add_option
(
cmdoptions
.
global_options
())
self
.
cmd_opts
.
add_option
(
'--pre'
,
...
...
tests/functional/test_warning.py
浏览文件 @
64681084
...
...
@@ -42,3 +42,8 @@ def test_version_warning_is_not_shown_if_python_version_is_not_2(script):
def
test_flag_does_nothing_if_python_version_is_not_2
(
script
):
script
.
pip
(
"list"
,
"--no-python-version-warning"
)
def
test_pip_works_with_warnings_as_errors
(
script
):
script
.
environ
[
'PYTHONWARNINGS'
]
=
'error'
script
.
pip
(
"--version"
)
tests/lib/venv.py
浏览文件 @
64681084
import
compileall
import
shutil
import
subprocess
import
sys
import
textwrap
import
venv
as
_venv
...
...
@@ -55,11 +56,16 @@ class VirtualEnvironment:
else
:
# Create a new virtual environment.
if
self
.
_venv_type
==
"virtualenv"
:
_virtualenv
.
create_environment
(
self
.
location
,
no_pip
=
True
,
no_wheel
=
True
,
no_setuptools
=
True
,
subprocess
.
check_call
(
[
sys
.
executable
,
"-m"
,
"virtualenv"
,
"--no-pip"
,
"--no-wheel"
,
"--no-setuptools"
,
str
(
self
.
location
),
]
)
self
.
_fix_virtualenv_site_module
()
elif
self
.
_venv_type
==
"venv"
:
...
...
tests/unit/test_command_install.py
浏览文件 @
64681084
...
...
@@ -4,6 +4,7 @@ from unittest.mock import patch
import
pytest
from
pip._vendor.packaging.requirements
import
Requirement
from
pip._internal.commands
import
install
from
pip._internal.commands.install
import
(
create_os_error_message
,
decide_user_install
,
...
...
@@ -109,7 +110,8 @@ def test_rejection_for_location_requirement_options():
' permissions.
\n
'
),
])
def
test_create_os_error_message
(
error
,
show_traceback
,
using_user_site
,
expected
monkeypatch
,
error
,
show_traceback
,
using_user_site
,
expected
):
monkeypatch
.
setattr
(
install
,
"running_under_virtualenv"
,
lambda
:
False
)
msg
=
create_os_error_message
(
error
,
show_traceback
,
using_user_site
)
assert
msg
==
expected
tests/unit/test_resolution_legacy_resolver.py
浏览文件 @
64681084
...
...
@@ -201,6 +201,10 @@ class TestYankedWarning:
"""
Test unyanked candidate preferred over yanked.
"""
# Ignore spurious DEBUG level messages
# TODO: Probably better to work out why they are occurring, but IMO the
# tests are at fault here for being to dependent on exact output.
caplog
.
set_level
(
logging
.
WARNING
)
candidates
=
[
make_mock_candidate
(
'1.0'
),
make_mock_candidate
(
'2.0'
,
yanked_reason
=
'bad metadata #2'
),
...
...
@@ -217,6 +221,10 @@ class TestYankedWarning:
"""
Test all candidates yanked.
"""
# Ignore spurious DEBUG level messages
# TODO: Probably better to work out why they are occurring, but IMO the
# tests are at fault here for being to dependent on exact output.
caplog
.
set_level
(
logging
.
WARNING
)
candidates
=
[
make_mock_candidate
(
'1.0'
,
yanked_reason
=
'bad metadata #1'
),
# Put the best candidate in the middle, to test sorting.
...
...
@@ -253,6 +261,10 @@ class TestYankedWarning:
"""
Test the log message with various reason strings.
"""
# Ignore spurious DEBUG level messages
# TODO: Probably better to work out why they are occurring, but IMO the
# tests are at fault here for being to dependent on exact output.
caplog
.
set_level
(
logging
.
WARNING
)
candidates
=
[
make_mock_candidate
(
'1.0'
,
yanked_reason
=
yanked_reason
),
]
...
...
tools/requirements/docs.txt
浏览文件 @
64681084
sphinx == 3.2.1
# FIXME: Remove towncrier constraint after upgrading sphinxcontrib-towncrier.
towncrier < 19.9.0
furo
myst_parser
sphinx-copybutton
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录