Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
b14a62f3
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,发现更多精彩内容 >>
提交
b14a62f3
编写于
9月 07, 2017
作者:
D
Donald Stufft
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Upgrade cachecontrol, setuptools, and pytoml
上级
4b5a0d55
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
92 addition
and
52 deletion
+92
-52
news/cachecontrol.vendor
news/cachecontrol.vendor
+1
-1
news/pytoml.vendor
news/pytoml.vendor
+1
-0
news/setuptools.vendor
news/setuptools.vendor
+1
-1
src/pip/_vendor/cachecontrol/__init__.py
src/pip/_vendor/cachecontrol/__init__.py
+1
-1
src/pip/_vendor/cachecontrol/caches/file_cache.py
src/pip/_vendor/cachecontrol/caches/file_cache.py
+1
-1
src/pip/_vendor/pkg_resources/__init__.py
src/pip/_vendor/pkg_resources/__init__.py
+67
-42
src/pip/_vendor/pytoml/parser.py
src/pip/_vendor/pytoml/parser.py
+8
-0
src/pip/_vendor/pytoml/writer.py
src/pip/_vendor/pytoml/writer.py
+9
-3
src/pip/_vendor/vendor.txt
src/pip/_vendor/vendor.txt
+3
-3
未找到文件。
news/cachecontrol.vendor
浏览文件 @
b14a62f3
Upgraded CacheControl to 0.12.
2
.
Upgraded CacheControl to 0.12.
3
.
news/pytoml.vendor
0 → 100644
浏览文件 @
b14a62f3
Upgraded pytoml to 0.1.14.
news/setuptools.vendor
浏览文件 @
b14a62f3
Upgraded pkg_resources (via setuptools) to 36.
2.6
.
Upgraded pkg_resources (via setuptools) to 36.
4.0
.
src/pip/_vendor/cachecontrol/__init__.py
浏览文件 @
b14a62f3
...
...
@@ -4,7 +4,7 @@ Make it easy to import from cachecontrol without long namespaces.
"""
__author__
=
'Eric Larson'
__email__
=
'eric@ionrock.org'
__version__
=
'0.12.
2
'
__version__
=
'0.12.
3
'
from
.wrapper
import
CacheControl
from
.adapter
import
CacheControlAdapter
...
...
src/pip/_vendor/cachecontrol/caches/file_cache.py
浏览文件 @
b14a62f3
...
...
@@ -9,7 +9,7 @@ try:
FileNotFoundError
except
NameError
:
# py2.X
FileNotFoundError
=
IO
Error
FileNotFoundError
=
OS
Error
def
_secure_open_write
(
filename
,
fmode
):
...
...
src/pip/_vendor/pkg_resources/__init__.py
浏览文件 @
b14a62f3
...
...
@@ -34,6 +34,7 @@ import platform
import
collections
import
plistlib
import
email.parser
import
errno
import
tempfile
import
textwrap
import
itertools
...
...
@@ -80,6 +81,11 @@ __import__('pip._vendor.packaging.markers')
if
(
3
,
0
)
<
sys
.
version_info
<
(
3
,
3
):
raise
RuntimeError
(
"Python 3.3 or later is required"
)
if
six
.
PY2
:
# Those builtin exceptions are only defined in Python 3
PermissionError
=
None
NotADirectoryError
=
None
# declare some globals that will be defined later to
# satisfy the linters.
require
=
None
...
...
@@ -852,7 +858,10 @@ class WorkingSet(object):
# distribution
env
=
Environment
([])
ws
=
WorkingSet
([])
dist
=
best
[
req
.
key
]
=
env
.
best_match
(
req
,
ws
,
installer
)
dist
=
best
[
req
.
key
]
=
env
.
best_match
(
req
,
ws
,
installer
,
replace_conflicting
=
replace_conflicting
)
if
dist
is
None
:
requirers
=
required_by
.
get
(
req
,
None
)
raise
DistributionNotFound
(
req
,
requirers
)
...
...
@@ -1104,7 +1113,7 @@ class Environment(object):
dists
.
append
(
dist
)
dists
.
sort
(
key
=
operator
.
attrgetter
(
'hashcmp'
),
reverse
=
True
)
def
best_match
(
self
,
req
,
working_set
,
installer
=
None
):
def
best_match
(
self
,
req
,
working_set
,
installer
=
None
,
replace_conflicting
=
False
):
"""Find distribution best matching `req` and usable on `working_set`
This calls the ``find(req)`` method of the `working_set` to see if a
...
...
@@ -1117,7 +1126,12 @@ class Environment(object):
calling the environment's ``obtain(req, installer)`` method will be
returned.
"""
dist
=
working_set
.
find
(
req
)
try
:
dist
=
working_set
.
find
(
req
)
except
VersionConflict
:
if
not
replace_conflicting
:
raise
dist
=
None
if
dist
is
not
None
:
return
dist
for
dist
in
self
[
req
.
key
]:
...
...
@@ -2008,46 +2022,57 @@ def find_on_path(importer, path_item, only=False):
"""Yield distributions accessible on a sys.path directory"""
path_item
=
_normalize_cached
(
path_item
)
if
os
.
path
.
isdir
(
path_item
)
and
os
.
access
(
path_item
,
os
.
R_OK
):
if
_is_unpacked_egg
(
path_item
):
yield
Distribution
.
from_filename
(
path_item
,
metadata
=
PathMetadata
(
path_item
,
os
.
path
.
join
(
path_item
,
'EGG-INFO'
)
)
if
_is_unpacked_egg
(
path_item
):
yield
Distribution
.
from_filename
(
path_item
,
metadata
=
PathMetadata
(
path_item
,
os
.
path
.
join
(
path_item
,
'EGG-INFO'
)
)
else
:
# scan for .egg and .egg-info in directory
path_item_entries
=
_by_version_descending
(
os
.
listdir
(
path_item
))
for
entry
in
path_item_entries
:
lower
=
entry
.
lower
()
if
lower
.
endswith
(
'.egg-info'
)
or
lower
.
endswith
(
'.dist-info'
):
fullpath
=
os
.
path
.
join
(
path_item
,
entry
)
if
os
.
path
.
isdir
(
fullpath
):
# egg-info directory, allow getting metadata
if
len
(
os
.
listdir
(
fullpath
))
==
0
:
# Empty egg directory, skip.
continue
metadata
=
PathMetadata
(
path_item
,
fullpath
)
else
:
metadata
=
FileMetadata
(
fullpath
)
yield
Distribution
.
from_location
(
path_item
,
entry
,
metadata
,
precedence
=
DEVELOP_DIST
)
elif
not
only
and
_is_egg_path
(
entry
):
dists
=
find_distributions
(
os
.
path
.
join
(
path_item
,
entry
))
for
dist
in
dists
:
yield
dist
elif
not
only
and
lower
.
endswith
(
'.egg-link'
):
with
open
(
os
.
path
.
join
(
path_item
,
entry
))
as
entry_file
:
entry_lines
=
entry_file
.
readlines
()
for
line
in
entry_lines
:
if
not
line
.
strip
():
continue
path
=
os
.
path
.
join
(
path_item
,
line
.
rstrip
())
dists
=
find_distributions
(
path
)
for
item
in
dists
:
yield
item
break
)
else
:
try
:
entries
=
os
.
listdir
(
path_item
)
except
(
PermissionError
,
NotADirectoryError
):
return
except
OSError
as
e
:
# Ignore the directory if does not exist, not a directory or we
# don't have permissions
if
(
e
.
errno
in
(
errno
.
ENOTDIR
,
errno
.
EACCES
,
errno
.
ENOENT
)
# Python 2 on Windows needs to be handled this way :(
or
hasattr
(
e
,
"winerror"
)
and
e
.
winerror
==
267
):
return
raise
# scan for .egg and .egg-info in directory
path_item_entries
=
_by_version_descending
(
entries
)
for
entry
in
path_item_entries
:
lower
=
entry
.
lower
()
if
lower
.
endswith
(
'.egg-info'
)
or
lower
.
endswith
(
'.dist-info'
):
fullpath
=
os
.
path
.
join
(
path_item
,
entry
)
if
os
.
path
.
isdir
(
fullpath
):
# egg-info directory, allow getting metadata
if
len
(
os
.
listdir
(
fullpath
))
==
0
:
# Empty egg directory, skip.
continue
metadata
=
PathMetadata
(
path_item
,
fullpath
)
else
:
metadata
=
FileMetadata
(
fullpath
)
yield
Distribution
.
from_location
(
path_item
,
entry
,
metadata
,
precedence
=
DEVELOP_DIST
)
elif
not
only
and
_is_egg_path
(
entry
):
dists
=
find_distributions
(
os
.
path
.
join
(
path_item
,
entry
))
for
dist
in
dists
:
yield
dist
elif
not
only
and
lower
.
endswith
(
'.egg-link'
):
with
open
(
os
.
path
.
join
(
path_item
,
entry
))
as
entry_file
:
entry_lines
=
entry_file
.
readlines
()
for
line
in
entry_lines
:
if
not
line
.
strip
():
continue
path
=
os
.
path
.
join
(
path_item
,
line
.
rstrip
())
dists
=
find_distributions
(
path
)
for
item
in
dists
:
yield
item
break
register_finder
(
pkgutil
.
ImpImporter
,
find_on_path
)
...
...
src/pip/_vendor/pytoml/parser.py
浏览文件 @
b14a62f3
...
...
@@ -209,6 +209,14 @@ def _p_key(s):
r
=
_p_basicstr_content
(
s
,
_basicstr_re
)
s
.
expect
(
'"'
)
return
r
if
s
.
consume
(
'
\'
'
):
if
s
.
consume
(
'
\'\'
'
):
r
=
s
.
expect_re
(
_litstr_ml_re
).
group
(
0
)
s
.
expect
(
'
\'\'\'
'
)
else
:
r
=
s
.
expect_re
(
_litstr_re
).
group
(
0
)
s
.
expect
(
'
\'
'
)
return
r
return
s
.
expect_re
(
_key_re
).
group
(
0
)
_float_re
=
re
.
compile
(
r
'[+-]?(?:0|[1-9](?:_?\d)*)(?:\.\d(?:_?\d)*)?(?:[eE][+-]?(?:\d(?:_?\d)*))?'
)
...
...
src/pip/_vendor/pytoml/writer.py
浏览文件 @
b14a62f3
from
__future__
import
unicode_literals
import
io
,
datetime
,
sys
import
io
,
datetime
,
math
,
sys
if
sys
.
version_info
[
0
]
==
3
:
long
=
int
...
...
@@ -61,7 +61,10 @@ def _format_value(v):
if
isinstance
(
v
,
int
)
or
isinstance
(
v
,
long
):
return
unicode
(
v
)
if
isinstance
(
v
,
float
):
return
repr
(
v
)
if
math
.
isnan
(
v
)
or
math
.
isinf
(
v
):
raise
ValueError
(
"{0} is not a valid TOML value"
.
format
(
v
))
else
:
return
repr
(
v
)
elif
isinstance
(
v
,
unicode
)
or
isinstance
(
v
,
bytes
):
return
_escape_string
(
v
)
elif
isinstance
(
v
,
datetime
.
datetime
):
...
...
@@ -102,6 +105,7 @@ def dump(obj, fout, sort_keys=False):
table_keys
=
sorted
(
table
.
keys
())
if
sort_keys
else
table
.
keys
()
new_tables
=
[]
has_kv
=
False
for
k
in
table_keys
:
v
=
table
[
k
]
if
isinstance
(
v
,
dict
):
...
...
@@ -112,10 +116,12 @@ def dump(obj, fout, sort_keys=False):
# based on mojombo's comment: https://github.com/toml-lang/toml/issues/146#issuecomment-25019344
fout
.
write
(
'#{} = null # To use: uncomment and replace null with value
\n
'
.
format
(
_escape_id
(
k
)))
has_kv
=
True
else
:
fout
.
write
(
'{0} = {1}
\n
'
.
format
(
_escape_id
(
k
),
_format_value
(
v
)))
has_kv
=
True
tables
.
extend
(
reversed
(
new_tables
))
if
tables
:
if
(
name
or
has_kv
)
and
tables
:
fout
.
write
(
'
\n
'
)
src/pip/_vendor/vendor.txt
浏览文件 @
b14a62f3
...
...
@@ -4,15 +4,15 @@ distro==1.0.4
html5lib==1.0b10
six==1.10.0
colorama==0.3.9
CacheControl==0.12.
2
CacheControl==0.12.
3
msgpack-python==0.4.8
lockfile==0.12.2
progress==1.3
ipaddress==1.0.18 # Only needed on 2.6 and 2.7
packaging==16.8
pyparsing==2.2.0
pytoml==0.1.1
2
pytoml==0.1.1
4
retrying==1.3.3
requests==2.14.2
setuptools==36.
2.6
setuptools==36.
4.0
webencodings==0.5.1
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录