Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
64bf4dc3
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 搜索 >>
未验证
提交
64bf4dc3
编写于
4月 17, 2018
作者:
P
Paul Moore
提交者:
GitHub
4月 17, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5257 from pfmoore/distlib_027
Update distlib to 0.2.7
上级
9875055f
493eaf0c
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
70 addition
and
25 deletion
+70
-25
news/distlib.vendor
news/distlib.vendor
+1
-0
src/pip/_vendor/distlib/__init__.py
src/pip/_vendor/distlib/__init__.py
+1
-1
src/pip/_vendor/distlib/compat.py
src/pip/_vendor/distlib/compat.py
+14
-11
src/pip/_vendor/distlib/database.py
src/pip/_vendor/distlib/database.py
+25
-7
src/pip/_vendor/distlib/locators.py
src/pip/_vendor/distlib/locators.py
+1
-1
src/pip/_vendor/distlib/metadata.py
src/pip/_vendor/distlib/metadata.py
+27
-4
src/pip/_vendor/distlib/t32.exe
src/pip/_vendor/distlib/t32.exe
+0
-0
src/pip/_vendor/distlib/t64.exe
src/pip/_vendor/distlib/t64.exe
+0
-0
src/pip/_vendor/distlib/w32.exe
src/pip/_vendor/distlib/w32.exe
+0
-0
src/pip/_vendor/distlib/w64.exe
src/pip/_vendor/distlib/w64.exe
+0
-0
src/pip/_vendor/vendor.txt
src/pip/_vendor/vendor.txt
+1
-1
未找到文件。
news/distlib.vendor
0 → 100644
浏览文件 @
64bf4dc3
Upgrade distlib to 0.2.7
src/pip/_vendor/distlib/__init__.py
浏览文件 @
64bf4dc3
...
...
@@ -6,7 +6,7 @@
#
import
logging
__version__
=
'0.2.
6
'
__version__
=
'0.2.
7
'
class
DistlibException
(
Exception
):
pass
...
...
src/pip/_vendor/distlib/compat.py
浏览文件 @
64bf4dc3
...
...
@@ -614,17 +614,20 @@ except ImportError: # pragma: no cover
self
.
maps
[
0
].
clear
()
try
:
from
imp
import
cache_from_source
except
ImportError
:
# pragma: no cover
def
cache_from_source
(
path
,
debug_override
=
None
):
assert
path
.
endswith
(
'.py'
)
if
debug_override
is
None
:
debug_override
=
__debug__
if
debug_override
:
suffix
=
'c'
else
:
suffix
=
'o'
return
path
+
suffix
from
importlib.util
import
cache_from_source
# Python >= 3.4
except
ImportError
:
# pragma: no cover
try
:
from
imp
import
cache_from_source
except
ImportError
:
# pragma: no cover
def
cache_from_source
(
path
,
debug_override
=
None
):
assert
path
.
endswith
(
'.py'
)
if
debug_override
is
None
:
debug_override
=
__debug__
if
debug_override
:
suffix
=
'c'
else
:
suffix
=
'o'
return
path
+
suffix
try
:
from
collections
import
OrderedDict
...
...
src/pip/_vendor/distlib/database.py
浏览文件 @
64bf4dc3
...
...
@@ -534,9 +534,10 @@ class InstalledDistribution(BaseInstalledDistribution):
hasher
=
'sha256'
def
__init__
(
self
,
path
,
metadata
=
None
,
env
=
None
):
self
.
modules
=
[]
self
.
finder
=
finder
=
resources
.
finder_for_path
(
path
)
if
finder
is
None
:
import
pdb
;
pdb
.
set_trace
(
)
raise
ValueError
(
'finder unavailable for %s'
%
path
)
if
env
and
env
.
_cache_enabled
and
path
in
env
.
_cache
.
path
:
metadata
=
env
.
_cache
.
path
[
path
].
metadata
elif
metadata
is
None
:
...
...
@@ -558,11 +559,13 @@ class InstalledDistribution(BaseInstalledDistribution):
if
env
and
env
.
_cache_enabled
:
env
.
_cache
.
add
(
self
)
try
:
r
=
finder
.
find
(
'REQUESTED'
)
except
AttributeError
:
import
pdb
;
pdb
.
set_trace
()
r
=
finder
.
find
(
'REQUESTED'
)
self
.
requested
=
r
is
not
None
p
=
os
.
path
.
join
(
path
,
'top_level.txt'
)
if
os
.
path
.
exists
(
p
):
with
open
(
p
,
'rb'
)
as
f
:
data
=
f
.
read
()
self
.
modules
=
data
.
splitlines
()
def
__repr__
(
self
):
return
'<InstalledDistribution %r %s at %r>'
%
(
...
...
@@ -922,11 +925,14 @@ class EggInfoDistribution(BaseInstalledDistribution):
pass
return
reqs
tl_path
=
tl_data
=
None
if
path
.
endswith
(
'.egg'
):
if
os
.
path
.
isdir
(
path
):
meta_path
=
os
.
path
.
join
(
path
,
'EGG-INFO'
,
'PKG-INFO'
)
p
=
os
.
path
.
join
(
path
,
'EGG-INFO'
)
meta_path
=
os
.
path
.
join
(
p
,
'PKG-INFO'
)
metadata
=
Metadata
(
path
=
meta_path
,
scheme
=
'legacy'
)
req_path
=
os
.
path
.
join
(
path
,
'EGG-INFO'
,
'requires.txt'
)
req_path
=
os
.
path
.
join
(
p
,
'requires.txt'
)
tl_path
=
os
.
path
.
join
(
p
,
'top_level.txt'
)
requires
=
parse_requires_path
(
req_path
)
else
:
# FIXME handle the case where zipfile is not available
...
...
@@ -936,6 +942,7 @@ class EggInfoDistribution(BaseInstalledDistribution):
metadata
=
Metadata
(
fileobj
=
fileobj
,
scheme
=
'legacy'
)
try
:
data
=
zipf
.
get_data
(
'EGG-INFO/requires.txt'
)
tl_data
=
zipf
.
get_data
(
'EGG-INFO/top_level.txt'
).
decode
(
'utf-8'
)
requires
=
parse_requires_data
(
data
.
decode
(
'utf-8'
))
except
IOError
:
requires
=
None
...
...
@@ -944,6 +951,7 @@ class EggInfoDistribution(BaseInstalledDistribution):
req_path
=
os
.
path
.
join
(
path
,
'requires.txt'
)
requires
=
parse_requires_path
(
req_path
)
path
=
os
.
path
.
join
(
path
,
'PKG-INFO'
)
tl_path
=
os
.
path
.
join
(
path
,
'top_level.txt'
)
metadata
=
Metadata
(
path
=
path
,
scheme
=
'legacy'
)
else
:
raise
DistlibException
(
'path must end with .egg-info or .egg, '
...
...
@@ -951,6 +959,16 @@ class EggInfoDistribution(BaseInstalledDistribution):
if
requires
:
metadata
.
add_requirements
(
requires
)
# look for top-level modules in top_level.txt, if present
if
tl_data
is
None
:
if
tl_path
is
not
None
and
os
.
path
.
exists
(
tl_path
):
with
open
(
tl_path
,
'rb'
)
as
f
:
tl_data
=
f
.
read
().
decode
(
'utf-8'
)
if
not
tl_data
:
tl_data
=
[]
else
:
tl_data
=
tl_data
.
splitlines
()
self
.
modules
=
tl_data
return
metadata
def
__repr__
(
self
):
...
...
src/pip/_vendor/distlib/locators.py
浏览文件 @
64bf4dc3
...
...
@@ -197,7 +197,7 @@ class Locator(object):
is_downloadable
=
basename
.
endswith
(
self
.
downloadable_extensions
)
if
is_wheel
:
compatible
=
is_compatible
(
Wheel
(
basename
),
self
.
wheel_tags
)
return
(
t
.
scheme
!
=
'https'
,
'pypi.python.org'
in
t
.
netloc
,
return
(
t
.
scheme
=
=
'https'
,
'pypi.python.org'
in
t
.
netloc
,
is_downloadable
,
is_wheel
,
compatible
,
basename
)
def
prefer_url
(
self
,
url1
,
url2
):
...
...
src/pip/_vendor/distlib/metadata.py
浏览文件 @
64bf4dc3
...
...
@@ -91,11 +91,16 @@ _426_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform',
_426_MARKERS
=
(
'Private-Version'
,
'Provides-Extra'
,
'Obsoleted-By'
,
'Setup-Requires-Dist'
,
'Extension'
)
_566_FIELDS
=
_426_FIELDS
+
(
'Description-Content-Type'
,)
_566_MARKERS
=
(
'Description-Content-Type'
,)
_ALL_FIELDS
=
set
()
_ALL_FIELDS
.
update
(
_241_FIELDS
)
_ALL_FIELDS
.
update
(
_314_FIELDS
)
_ALL_FIELDS
.
update
(
_345_FIELDS
)
_ALL_FIELDS
.
update
(
_426_FIELDS
)
_ALL_FIELDS
.
update
(
_566_FIELDS
)
EXTRA_RE
=
re
.
compile
(
r
'''extra\s*==\s*("([^"]+)"|'([^']+)')'''
)
...
...
@@ -107,6 +112,8 @@ def _version2fieldlist(version):
return
_314_FIELDS
elif
version
==
'1.2'
:
return
_345_FIELDS
elif
version
in
(
'1.3'
,
'2.1'
):
return
_345_FIELDS
+
_566_FIELDS
elif
version
==
'2.0'
:
return
_426_FIELDS
raise
MetadataUnrecognizedVersionError
(
version
)
...
...
@@ -126,38 +133,51 @@ def _best_version(fields):
continue
keys
.
append
(
key
)
possible_versions
=
[
'1.0'
,
'1.1'
,
'1.2'
,
'
2.0
'
]
possible_versions
=
[
'1.0'
,
'1.1'
,
'1.2'
,
'
1.3'
,
'2.0'
,
'2.1
'
]
# first let's try to see if a field is not part of one of the version
for
key
in
keys
:
if
key
not
in
_241_FIELDS
and
'1.0'
in
possible_versions
:
possible_versions
.
remove
(
'1.0'
)
logger
.
debug
(
'Removed 1.0 due to %s'
,
key
)
if
key
not
in
_314_FIELDS
and
'1.1'
in
possible_versions
:
possible_versions
.
remove
(
'1.1'
)
logger
.
debug
(
'Removed 1.1 due to %s'
,
key
)
if
key
not
in
_345_FIELDS
and
'1.2'
in
possible_versions
:
possible_versions
.
remove
(
'1.2'
)
logger
.
debug
(
'Removed 1.2 due to %s'
,
key
)
if
key
not
in
_566_FIELDS
and
'1.3'
in
possible_versions
:
possible_versions
.
remove
(
'1.3'
)
logger
.
debug
(
'Removed 1.3 due to %s'
,
key
)
if
key
not
in
_566_FIELDS
and
'2.1'
in
possible_versions
:
if
key
!=
'Description'
:
# In 2.1, description allowed after headers
possible_versions
.
remove
(
'2.1'
)
logger
.
debug
(
'Removed 2.1 due to %s'
,
key
)
if
key
not
in
_426_FIELDS
and
'2.0'
in
possible_versions
:
possible_versions
.
remove
(
'2.0'
)
logger
.
debug
(
'Removed 2.0 due to %s'
,
key
)
# possible_version contains qualified versions
if
len
(
possible_versions
)
==
1
:
return
possible_versions
[
0
]
# found !
elif
len
(
possible_versions
)
==
0
:
logger
.
debug
(
'Out of options - unknown metadata set: %s'
,
fields
)
raise
MetadataConflictError
(
'Unknown metadata set'
)
# let's see if one unique marker is found
is_1_1
=
'1.1'
in
possible_versions
and
_has_marker
(
keys
,
_314_MARKERS
)
is_1_2
=
'1.2'
in
possible_versions
and
_has_marker
(
keys
,
_345_MARKERS
)
is_2_1
=
'2.1'
in
possible_versions
and
_has_marker
(
keys
,
_566_MARKERS
)
is_2_0
=
'2.0'
in
possible_versions
and
_has_marker
(
keys
,
_426_MARKERS
)
if
int
(
is_1_1
)
+
int
(
is_1_2
)
+
int
(
is_2_0
)
>
1
:
raise
MetadataConflictError
(
'You used incompatible 1.1/1.2/2.0 fields'
)
if
int
(
is_1_1
)
+
int
(
is_1_2
)
+
int
(
is_2_
1
)
+
int
(
is_2_
0
)
>
1
:
raise
MetadataConflictError
(
'You used incompatible 1.1/1.2/2.0
/2.1
fields'
)
# we have the choice, 1.0, or 1.2, or 2.0
# - 1.0 has a broken Summary field but works with all tools
# - 1.1 is to avoid
# - 1.2 fixes Summary but has little adoption
# - 2.0 adds more features and is very new
if
not
is_1_1
and
not
is_1_2
and
not
is_2_0
:
if
not
is_1_1
and
not
is_1_2
and
not
is_2_
1
and
not
is_2_
0
:
# we couldn't find any specific marker
if
PKG_INFO_PREFERRED_VERSION
in
possible_versions
:
return
PKG_INFO_PREFERRED_VERSION
...
...
@@ -165,6 +185,8 @@ def _best_version(fields):
return
'1.1'
if
is_1_2
:
return
'1.2'
if
is_2_1
:
return
'2.1'
return
'2.0'
...
...
@@ -355,6 +377,7 @@ class LegacyMetadata(object):
value
=
msg
[
field
]
if
value
is
not
None
and
value
!=
'UNKNOWN'
:
self
.
set
(
field
,
value
)
logger
.
debug
(
'Attempting to set metadata for %s'
,
self
)
self
.
set_metadata_version
()
def
write
(
self
,
filepath
,
skip_unknown
=
False
):
...
...
src/pip/_vendor/distlib/t32.exe
浏览文件 @
64bf4dc3
无法预览此类型文件
src/pip/_vendor/distlib/t64.exe
浏览文件 @
64bf4dc3
无法预览此类型文件
src/pip/_vendor/distlib/w32.exe
浏览文件 @
64bf4dc3
无法预览此类型文件
src/pip/_vendor/distlib/w64.exe
浏览文件 @
64bf4dc3
无法预览此类型文件
src/pip/_vendor/vendor.txt
浏览文件 @
64bf4dc3
appdirs==1.4.3
distlib==0.2.
6
distlib==0.2.
7
distro==1.2.0
html5lib==1.0.1
six==1.11.0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录