Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
5e072e2e
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,发现更多精彩内容 >>
未验证
提交
5e072e2e
编写于
4月 04, 2021
作者:
T
Tzu-ping Chung
提交者:
GitHub
4月 04, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9773 from sbidoul/fix-pre-commit-ci
上级
fb57da10
29c50c81
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
8 deletion
+13
-8
.github/workflows/ci.yml
.github/workflows/ci.yml
+1
-1
docs/pip_sphinxext.py
docs/pip_sphinxext.py
+7
-4
news/9748.feature.rst
news/9748.feature.rst
+1
-1
src/pip/_internal/models/wheel.py
src/pip/_internal/models/wheel.py
+4
-2
未找到文件。
.github/workflows/ci.yml
浏览文件 @
5e072e2e
...
...
@@ -43,7 +43,7 @@ jobs:
-
uses
:
actions/setup-python@v2
-
uses
:
pre-commit/action@v2.0.0
with
:
extra_args
:
--hook-stage=manual
extra_args
:
--
all-files --
hook-stage=manual
packaging
:
name
:
packaging
...
...
docs/pip_sphinxext.py
浏览文件 @
5e072e2e
...
...
@@ -5,7 +5,7 @@ import pathlib
import
re
import
sys
from
textwrap
import
dedent
from
typing
import
Iterable
,
List
,
Optional
from
typing
import
Iterable
,
Iterator
,
List
,
Optional
from
docutils
import
nodes
,
statemachine
from
docutils.parsers
import
rst
...
...
@@ -20,7 +20,9 @@ from pip._internal.req.req_file import SUPPORTED_OPTIONS
class
PipNewsInclude
(
rst
.
Directive
):
required_arguments
=
1
def
_is_version_section_title_underline
(
self
,
prev
,
curr
):
def
_is_version_section_title_underline
(
self
,
prev
:
Optional
[
str
],
curr
:
str
)
->
bool
:
"""Find a ==== line that marks the version section title."""
if
prev
is
None
:
return
False
...
...
@@ -30,7 +32,7 @@ class PipNewsInclude(rst.Directive):
return
False
return
True
def
_iter_lines_with_refs
(
self
,
lines
)
:
def
_iter_lines_with_refs
(
self
,
lines
:
Iterable
[
str
])
->
Iterator
[
str
]
:
"""Transform the input lines to add a ref before each section title.
This is done by looking one line ahead and locate a title's underline,
...
...
@@ -44,6 +46,7 @@ class PipNewsInclude(rst.Directive):
for
line
in
lines
:
# Transform the previous line to include an explicit ref.
if
self
.
_is_version_section_title_underline
(
prev
,
line
):
assert
prev
is
not
None
vref
=
prev
.
split
(
None
,
1
)[
0
].
replace
(
"."
,
"-"
)
yield
f
".. _`v
{
vref
}
`:"
yield
""
# Empty line between ref and the title.
...
...
@@ -53,7 +56,7 @@ class PipNewsInclude(rst.Directive):
if
prev
is
not
None
:
yield
prev
def
run
(
self
):
def
run
(
self
)
->
List
[
nodes
.
Node
]
:
source
=
self
.
state_machine
.
input_lines
.
source
(
self
.
lineno
-
self
.
state_machine
.
input_offset
-
1
,
)
...
...
news/9748.feature.rst
浏览文件 @
5e072e2e
Improve performance when picking the best file from indexes during `
pip install
`.
Improve performance when picking the best file from indexes during `
`pip install`
`.
src/pip/_internal/models/wheel.py
浏览文件 @
5e072e2e
...
...
@@ -2,7 +2,7 @@
name that have meaning.
"""
import
re
from
typing
import
Dict
,
List
from
typing
import
Dict
,
Iterable
,
List
from
pip._vendor.packaging.tags
import
Tag
...
...
@@ -82,7 +82,9 @@ class Wheel:
:raises ValueError: If none of the wheel's file tags match one of
the supported tags.
"""
return
min
(
tag_to_priority
[
tag
]
for
tag
in
self
.
file_tags
if
tag
in
tag_to_priority
)
return
min
(
tag_to_priority
[
tag
]
for
tag
in
self
.
file_tags
if
tag
in
tag_to_priority
)
def
supported
(
self
,
tags
):
# type: (Iterable[Tag]) -> bool
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录