Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
4f6bef6e
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,发现更多精彩内容 >>
未验证
提交
4f6bef6e
编写于
3月 12, 2020
作者:
P
Pradyun Gedam
提交者:
GitHub
3月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7792 from pradyunsg/misc/utils-tags
Rename pep425tags -> utils.compatibility_tags
上级
10f41571
3fa356a7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
36 addition
and
31 deletion
+36
-31
src/pip/_internal/models/target_python.py
src/pip/_internal/models/target_python.py
+6
-3
src/pip/_internal/req/req_install.py
src/pip/_internal/req/req_install.py
+2
-2
src/pip/_internal/req/req_set.py
src/pip/_internal/req/req_set.py
+2
-2
src/pip/_internal/utils/compatibility_tags.py
src/pip/_internal/utils/compatibility_tags.py
+3
-1
tests/functional/test_debug.py
tests/functional/test_debug.py
+2
-2
tests/unit/test_finder.py
tests/unit/test_finder.py
+2
-2
tests/unit/test_index.py
tests/unit/test_index.py
+1
-1
tests/unit/test_models_wheel.py
tests/unit/test_models_wheel.py
+11
-11
tests/unit/test_utils_compatibility_tags.py
tests/unit/test_utils_compatibility_tags.py
+7
-7
未找到文件。
src/pip/_internal/models/target_python.py
浏览文件 @
4f6bef6e
import
sys
from
pip._internal.pep425tags
import
get_supported
,
version_info_to_nodot
from
pip._internal.utils.compatibility_tags
import
(
get_supported
,
version_info_to_nodot
,
)
from
pip._internal.utils.misc
import
normalize_version_info
from
pip._internal.utils.typing
import
MYPY_CHECK_RUNNING
...
...
@@ -34,10 +37,10 @@ class TargetPython(object):
:param py_version_info: An optional tuple of ints representing the
Python version information to use (e.g. `sys.version_info[:3]`).
This can have length 1, 2, or 3 when provided.
:param abi: A string or None. This is passed to
pep425
tags.py's
:param abi: A string or None. This is passed to
compatibility_
tags.py's
get_supported() function as is.
:param implementation: A string or None. This is passed to
pep425
tags.py's get_supported() function as is.
compatibility_
tags.py's get_supported() function as is.
"""
# Store the given py_version_info for when we call get_supported().
self
.
_given_py_version_info
=
py_version_info
...
...
src/pip/_internal/req/req_install.py
浏览文件 @
4f6bef6e
...
...
@@ -16,7 +16,6 @@ from pip._vendor.packaging.version import Version
from
pip._vendor.packaging.version
import
parse
as
parse_version
from
pip._vendor.pep517.wrappers
import
Pep517HookCaller
from
pip._internal
import
pep425tags
from
pip._internal.build_env
import
NoOpBuildEnvironment
from
pip._internal.exceptions
import
InstallationError
from
pip._internal.locations
import
get_scheme
...
...
@@ -31,6 +30,7 @@ from pip._internal.operations.install.legacy import install as install_legacy
from
pip._internal.operations.install.wheel
import
install_wheel
from
pip._internal.pyproject
import
load_pyproject_toml
,
make_pyproject_path
from
pip._internal.req.req_uninstall
import
UninstallPathSet
from
pip._internal.utils
import
compatibility_tags
from
pip._internal.utils.deprecation
import
deprecated
from
pip._internal.utils.hashes
import
Hashes
from
pip._internal.utils.logging
import
indent_log
...
...
@@ -258,7 +258,7 @@ class InstallRequirement(object):
self
.
link
=
finder
.
find_requirement
(
self
,
upgrade
)
if
self
.
_wheel_cache
is
not
None
and
not
require_hashes
:
old_link
=
self
.
link
supported_tags
=
pep425
tags
.
get_supported
()
supported_tags
=
compatibility_
tags
.
get_supported
()
self
.
link
=
self
.
_wheel_cache
.
get
(
link
=
self
.
link
,
package_name
=
self
.
name
,
...
...
src/pip/_internal/req/req_set.py
浏览文件 @
4f6bef6e
...
...
@@ -8,9 +8,9 @@ from collections import OrderedDict
from
pip._vendor.packaging.utils
import
canonicalize_name
from
pip._internal
import
pep425tags
from
pip._internal.exceptions
import
InstallationError
from
pip._internal.models.wheel
import
Wheel
from
pip._internal.utils
import
compatibility_tags
from
pip._internal.utils.typing
import
MYPY_CHECK_RUNNING
if
MYPY_CHECK_RUNNING
:
...
...
@@ -102,7 +102,7 @@ class RequirementSet(object):
# single requirements file.
if
install_req
.
link
and
install_req
.
link
.
is_wheel
:
wheel
=
Wheel
(
install_req
.
link
.
filename
)
tags
=
pep425
tags
.
get_supported
()
tags
=
compatibility_
tags
.
get_supported
()
if
(
self
.
check_supported_wheels
and
not
wheel
.
supported
(
tags
)):
raise
InstallationError
(
"{} is not a supported wheel on this platform."
.
format
(
...
...
src/pip/_internal/
pep425
tags.py
→
src/pip/_internal/
utils/compatibility_
tags.py
浏览文件 @
4f6bef6e
"""Generate and work with PEP 425 Compatibility Tags."""
"""Generate and work with PEP 425 Compatibility Tags.
"""
from
__future__
import
absolute_import
import
logging
...
...
tests/functional/test_debug.py
浏览文件 @
4f6bef6e
import
pytest
from
pip._internal
import
pep425
tags
from
pip._internal
.utils
import
compatibility_
tags
@
pytest
.
mark
.
parametrize
(
'expected_text'
,
[
...
...
@@ -42,7 +42,7 @@ def test_debug__tags(script, args):
result
=
script
.
pip
(
*
args
,
allow_stderr_warning
=
True
)
stdout
=
result
.
stdout
tags
=
pep425
tags
.
get_supported
()
tags
=
compatibility_
tags
.
get_supported
()
expected_tag_header
=
'Compatible tags: {}'
.
format
(
len
(
tags
))
assert
expected_tag_header
in
stdout
...
...
tests/unit/test_finder.py
浏览文件 @
4f6bef6e
...
...
@@ -7,7 +7,7 @@ from pip._vendor.packaging.specifiers import SpecifierSet
from
pip._vendor.packaging.tags
import
Tag
from
pkg_resources
import
parse_version
import
pip._internal.
pep425
tags
import
pip._internal.
utils.compatibility_
tags
from
pip._internal.exceptions
import
(
BestVersionAlreadyInstalled
,
DistributionNotFound
,
...
...
@@ -171,7 +171,7 @@ class TestWheel:
Test finding supported wheel.
"""
monkeypatch
.
setattr
(
pip
.
_internal
.
pep425
tags
,
pip
.
_internal
.
utils
.
compatibility_
tags
,
"get_supported"
,
lambda
**
kw
:
[(
'py2'
,
'none'
,
'any'
)],
)
...
...
tests/unit/test_index.py
浏览文件 @
4f6bef6e
...
...
@@ -21,7 +21,7 @@ from pip._internal.models.search_scope import SearchScope
from
pip._internal.models.selection_prefs
import
SelectionPreferences
from
pip._internal.models.target_python
import
TargetPython
from
pip._internal.network.session
import
PipSession
from
pip._internal.
pep425
tags
import
get_supported
from
pip._internal.
utils.compatibility_
tags
import
get_supported
from
pip._internal.utils.hashes
import
Hashes
from
tests.lib
import
CURRENT_PY_VERSION_INFO
...
...
tests/unit/test_models_wheel.py
浏览文件 @
4f6bef6e
import
pytest
from
pip._vendor.packaging.tags
import
Tag
from
pip._internal
import
pep425tags
from
pip._internal.exceptions
import
InvalidWheelFilename
from
pip._internal.models.wheel
import
Wheel
from
pip._internal.utils
import
compatibility_tags
class
TestWheelFile
(
object
):
...
...
@@ -75,7 +75,7 @@ class TestWheelFile(object):
"""
Wheels built for macOS 10.6 are supported on 10.9
"""
tags
=
pep425
tags
.
get_supported
(
tags
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_9_intel'
,
impl
=
'cp'
)
w
=
Wheel
(
'simple-0.1-cp27-none-macosx_10_6_intel.whl'
)
...
...
@@ -87,7 +87,7 @@ class TestWheelFile(object):
"""
Wheels built for macOS 10.9 are not supported on 10.6
"""
tags
=
pep425
tags
.
get_supported
(
tags
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_6_intel'
,
impl
=
'cp'
)
w
=
Wheel
(
'simple-0.1-cp27-none-macosx_10_9_intel.whl'
)
...
...
@@ -97,22 +97,22 @@ class TestWheelFile(object):
"""
Multi-arch wheels (intel) are supported on components (i386, x86_64)
"""
universal
=
pep425
tags
.
get_supported
(
universal
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_universal'
,
impl
=
'cp'
)
intel
=
pep425
tags
.
get_supported
(
intel
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_intel'
,
impl
=
'cp'
)
x64
=
pep425
tags
.
get_supported
(
x64
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_x86_64'
,
impl
=
'cp'
)
i386
=
pep425
tags
.
get_supported
(
i386
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_i386'
,
impl
=
'cp'
)
ppc
=
pep425
tags
.
get_supported
(
ppc
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_ppc'
,
impl
=
'cp'
)
ppc64
=
pep425
tags
.
get_supported
(
ppc64
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_ppc64'
,
impl
=
'cp'
)
...
...
@@ -135,10 +135,10 @@ class TestWheelFile(object):
"""
Single-arch wheels (x86_64) are not supported on multi-arch (intel)
"""
universal
=
pep425
tags
.
get_supported
(
universal
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_universal'
,
impl
=
'cp'
)
intel
=
pep425
tags
.
get_supported
(
intel
=
compatibility_
tags
.
get_supported
(
'27'
,
platform
=
'macosx_10_5_intel'
,
impl
=
'cp'
)
...
...
tests/unit/test_
pep425
tags.py
→
tests/unit/test_
utils_compatibility_
tags.py
浏览文件 @
4f6bef6e
...
...
@@ -3,7 +3,7 @@ import sysconfig
import
pytest
from
mock
import
patch
from
pip._internal
import
pep425
tags
from
pip._internal
.utils
import
compatibility_
tags
@
pytest
.
mark
.
parametrize
(
'version_info, expected'
,
[
...
...
@@ -17,11 +17,11 @@ from pip._internal import pep425tags
((
3
,
10
),
'310'
),
])
def
test_version_info_to_nodot
(
version_info
,
expected
):
actual
=
pep425
tags
.
version_info_to_nodot
(
version_info
)
actual
=
compatibility_
tags
.
version_info_to_nodot
(
version_info
)
assert
actual
==
expected
class
Test
PEP425T
ags
(
object
):
class
Test
compatibility_t
ags
(
object
):
def
mock_get_config_var
(
self
,
**
kwd
):
"""
...
...
@@ -39,12 +39,12 @@ class TestPEP425Tags(object):
"""
Test that no tag contains a hyphen.
"""
import
pip._internal.
pep425
tags
import
pip._internal.
utils.compatibility_
tags
mock_gcf
=
self
.
mock_get_config_var
(
SOABI
=
'cpython-35m-darwin'
)
with
patch
(
'sysconfig.get_config_var'
,
mock_gcf
):
supported
=
pip
.
_internal
.
pep425
tags
.
get_supported
()
supported
=
pip
.
_internal
.
utils
.
compatibility_
tags
.
get_supported
()
for
tag
in
supported
:
assert
'-'
not
in
tag
.
interpreter
...
...
@@ -63,7 +63,7 @@ class TestManylinux2010Tags(object):
Specifying manylinux2010 implies manylinux1.
"""
groups
=
{}
supported
=
pep425
tags
.
get_supported
(
platform
=
manylinux2010
)
supported
=
compatibility_
tags
.
get_supported
(
platform
=
manylinux2010
)
for
tag
in
supported
:
groups
.
setdefault
(
(
tag
.
interpreter
,
tag
.
abi
),
[]
...
...
@@ -87,7 +87,7 @@ class TestManylinux2014Tags(object):
Specifying manylinux2014 implies manylinux2010/manylinux1.
"""
groups
=
{}
supported
=
pep425
tags
.
get_supported
(
platform
=
manylinuxA
)
supported
=
compatibility_
tags
.
get_supported
(
platform
=
manylinuxA
)
for
tag
in
supported
:
groups
.
setdefault
(
(
tag
.
interpreter
,
tag
.
abi
),
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录