Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
fea9766f
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 搜索 >>
提交
fea9766f
编写于
3月 26, 2020
作者:
P
Paul Moore
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into new_resolver_extras
上级
a68345e8
4f640526
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
78 addition
and
34 deletion
+78
-34
docs/html/development/getting-started.rst
docs/html/development/getting-started.rst
+20
-6
docs/html/reference/pip_install.rst
docs/html/reference/pip_install.rst
+1
-1
news/2808D551-576D-4239-BBB4-F5B9DB5E36A2.trivial
news/2808D551-576D-4239-BBB4-F5B9DB5E36A2.trivial
+0
-0
news/533EA005-0471-4D5D-A81B-B6904A844EEE.trivial
news/533EA005-0471-4D5D-A81B-B6904A844EEE.trivial
+0
-0
src/pip/_internal/resolution/resolvelib/provider.py
src/pip/_internal/resolution/resolvelib/provider.py
+4
-0
src/pip/_internal/resolution/resolvelib/requirements.py
src/pip/_internal/resolution/resolvelib/requirements.py
+0
-1
src/pip/_internal/resolution/resolvelib/resolver.py
src/pip/_internal/resolution/resolvelib/resolver.py
+5
-3
src/pip/_internal/utils/appdirs.py
src/pip/_internal/utils/appdirs.py
+6
-1
src/pip/_vendor/appdirs.py
src/pip/_vendor/appdirs.py
+0
-4
tests/functional/test_new_resolver.py
tests/functional/test_new_resolver.py
+31
-1
tests/unit/resolution_resolvelib/conftest.py
tests/unit/resolution_resolvelib/conftest.py
+6
-1
tools/automation/vendoring/patches/appdirs.patch
tools/automation/vendoring/patches/appdirs.patch
+5
-16
未找到文件。
docs/html/development/getting-started.rst
浏览文件 @
fea9766f
...
...
@@ -49,18 +49,18 @@ pip's tests are written using the :pypi:`pytest` test framework, :pypi:`mock`
and :pypi:`pretend`. :pypi:`tox` is used to automate the setup and execution of
pip's tests.
To run tests locally, run:
It is preferable to run the tests in parallel for better experience during development,
since the tests can take a long time to finish when run sequentially.
To run tests:
.. code-block:: console
$ tox -e py36
Generally, it can take a long time to run pip's test suite. To run tests in parallel,
which is faster, run:
$ tox -e py36 -- -n auto
To run tests without parallelization, run:
.. code-block:: console
$ tox -e py36
-- -n auto
$ tox -e py36
The example above runs tests against Python 3.6. You can also use other
versions like ``py27`` and ``pypy3``.
...
...
@@ -123,8 +123,22 @@ To build it locally, run:
The built documentation can be found in the ``docs/build`` folder.
What Next?
==========
The following pages may be helpful for new contributors on where to look next
in order to start contributing.
* Some `good first issues`_ on GitHub for new contributors
* A deep dive into `pip's architecture`_
* A guide on `triaging issues`_ for issue tracker
.. _`open an issue`: https://github.com/pypa/pip/issues/new?title=Trouble+with+pip+development+environment
.. _`install Python`: https://realpython.com/installing-python/
.. _`PEP 484 type-comments`: https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code
.. _`rich CLI`: https://docs.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests
.. _`GitHub`: https://github.com/pypa/pip
.. _`good first issues`: https://github.com/pypa/pip/labels/good%20first%20issue
.. _`pip's architecture`: https://pip.pypa.io/en/latest/development/architecture/
.. _`triaging issues`: https://pip.pypa.io/en/latest/development/issue-triage/
docs/html/reference/pip_install.rst
浏览文件 @
fea9766f
...
...
@@ -506,7 +506,7 @@ Finding Packages
pip
searches
for
packages
on
`
PyPI
`
_
using
the
`
HTTP
simple
interface
<
https
://
pypi
.
org
/
simple
/>`
_
,
which
is
documented
`
here
<
https
://
setuptools
.
readthedocs
.
io
/
en
/
latest
/
easy_install
.
html
#
package
-
index
-
api
>`
_
and
`
there
<
https
://
www
.
python
.
org
/
dev
/
peps
/
pep
-
0
301
/>`
_
.
and
`
there
<
https
://
www
.
python
.
org
/
dev
/
peps
/
pep
-
0
503
/>`
_
.
pip
offers
a
number
of
package
index
options
for
modifying
how
packages
are
found
.
...
...
news/2808D551-576D-4239-BBB4-F5B9DB5E36A2.trivial
0 → 100644
浏览文件 @
fea9766f
news/533EA005-0471-4D5D-A81B-B6904A844EEE.trivial
0 → 100644
浏览文件 @
fea9766f
src/pip/_internal/resolution/resolvelib/provider.py
浏览文件 @
fea9766f
...
...
@@ -20,11 +20,13 @@ class PipProvider(AbstractProvider):
self
,
finder
,
# type: PackageFinder
preparer
,
# type: RequirementPreparer
ignore_dependencies
,
# type: bool
make_install_req
# type: InstallRequirementProvider
):
# type: (...) -> None
self
.
_finder
=
finder
self
.
_preparer
=
preparer
self
.
_ignore_dependencies
=
ignore_dependencies
self
.
_make_install_req
=
make_install_req
def
make_requirement
(
self
,
ireq
):
...
...
@@ -64,6 +66,8 @@ class PipProvider(AbstractProvider):
def
get_dependencies
(
self
,
candidate
):
# type: (Candidate) -> Sequence[Requirement]
if
self
.
_ignore_dependencies
:
return
[]
return
[
make_requirement
(
r
,
...
...
src/pip/_internal/resolution/resolvelib/requirements.py
浏览文件 @
fea9766f
...
...
@@ -103,7 +103,6 @@ class SpecifierRequirement(Requirement):
def
is_satisfied_by
(
self
,
candidate
):
# type: (Candidate) -> bool
assert
candidate
.
name
==
self
.
name
,
\
"Internal issue: Candidate is not for this requirement "
\
" {} vs {}"
.
format
(
candidate
.
name
,
self
.
name
)
...
...
src/pip/_internal/resolution/resolvelib/resolver.py
浏览文件 @
fea9766f
...
...
@@ -37,15 +37,17 @@ class Resolver(BaseResolver):
super
(
Resolver
,
self
).
__init__
()
self
.
finder
=
finder
self
.
preparer
=
preparer
self
.
ignore_dependencies
=
ignore_dependencies
self
.
make_install_req
=
make_install_req
self
.
_result
=
None
# type: Optional[Result]
def
resolve
(
self
,
root_reqs
,
check_supported_wheels
):
# type: (List[InstallRequirement], bool) -> RequirementSet
provider
=
PipProvider
(
self
.
finder
,
self
.
preparer
,
self
.
make_install_req
,
finder
=
self
.
finder
,
preparer
=
self
.
preparer
,
ignore_dependencies
=
self
.
ignore_dependencies
,
make_install_req
=
self
.
make_install_req
,
)
reporter
=
BaseReporter
()
resolver
=
RLResolver
(
provider
,
reporter
)
...
...
src/pip/_internal/utils/appdirs.py
浏览文件 @
fea9766f
...
...
@@ -25,7 +25,12 @@ def user_cache_dir(appname):
def
user_config_dir
(
appname
,
roaming
=
True
):
# type: (str, bool) -> str
return
_appdirs
.
user_config_dir
(
appname
,
appauthor
=
False
,
roaming
=
roaming
)
path
=
_appdirs
.
user_config_dir
(
appname
,
appauthor
=
False
,
roaming
=
roaming
)
if
_appdirs
.
system
==
"darwin"
and
not
os
.
path
.
isdir
(
path
):
path
=
os
.
path
.
expanduser
(
'~/.config/'
)
if
appname
:
path
=
os
.
path
.
join
(
path
,
appname
)
return
path
# for the discussion regarding site_config_dir locations
...
...
src/pip/_vendor/appdirs.py
浏览文件 @
fea9766f
...
...
@@ -92,10 +92,6 @@ def user_data_dir(appname=None, appauthor=None, version=None, roaming=False):
path
=
os
.
path
.
expanduser
(
'~/Library/Application Support/'
)
if
appname
:
path
=
os
.
path
.
join
(
path
,
appname
)
if
not
os
.
path
.
isdir
(
path
):
path
=
os
.
path
.
expanduser
(
'~/.config/'
)
if
appname
:
path
=
os
.
path
.
join
(
path
,
appname
)
else
:
path
=
os
.
getenv
(
'XDG_DATA_HOME'
,
os
.
path
.
expanduser
(
"~/.local/share"
))
if
appname
:
...
...
tests/functional/test_new_resolver.py
浏览文件 @
fea9766f
...
...
@@ -9,7 +9,15 @@ def assert_installed(script, **kwargs):
(
val
[
'name'
],
val
[
'version'
])
for
val
in
json
.
loads
(
ret
.
stdout
)
)
assert
set
(
kwargs
.
items
())
<=
installed
assert
all
(
item
in
installed
for
item
in
kwargs
.
items
()),
\
"{!r} not all in {!r}"
.
format
(
kwargs
,
installed
)
def
assert_not_installed
(
script
,
*
args
):
ret
=
script
.
pip
(
"list"
,
"--format=json"
)
installed
=
set
(
val
[
"name"
]
for
val
in
json
.
loads
(
ret
.
stdout
))
assert
all
(
a
not
in
installed
for
a
in
args
),
\
"{!r} contained in {!r}"
.
format
(
args
,
installed
)
def
test_new_resolver_can_install
(
script
):
...
...
@@ -83,6 +91,28 @@ def test_new_resolver_installs_dependencies(script):
assert_installed
(
script
,
base
=
"0.1.0"
,
dep
=
"0.1.0"
)
def
test_new_resolver_ignore_dependencies
(
script
):
create_basic_wheel_for_package
(
script
,
"base"
,
"0.1.0"
,
depends
=
[
"dep"
],
)
create_basic_wheel_for_package
(
script
,
"dep"
,
"0.1.0"
,
)
script
.
pip
(
"install"
,
"--unstable-feature=resolver"
,
"--no-cache-dir"
,
"--no-index"
,
"--no-deps"
,
"--find-links"
,
script
.
scratch_path
,
"base"
)
assert_installed
(
script
,
base
=
"0.1.0"
)
assert_not_installed
(
script
,
"dep"
)
def
test_new_resolver_installs_extras
(
script
):
create_basic_wheel_for_package
(
script
,
...
...
tests/unit/resolution_resolvelib/conftest.py
浏览文件 @
fea9766f
...
...
@@ -55,4 +55,9 @@ def provider(finder, preparer):
wheel_cache
=
None
,
use_pep517
=
None
,
)
yield
PipProvider
(
finder
,
preparer
,
make_install_req
)
yield
PipProvider
(
finder
=
finder
,
preparer
=
preparer
,
ignore_dependencies
=
False
,
make_install_req
=
make_install_req
,
)
tools/automation/vendoring/patches/appdirs.patch
浏览文件 @
fea9766f
...
...
@@ -22,18 +22,7 @@ index ae67001a..3a52b758 100644
Unix: ~/.local/share/<AppName> # or in $XDG_DATA_HOME, if defined
Win XP (not roaming): C:\Documents and Settings\<username>\Application Data\<AppAuthor>\<AppName>
Win XP (roaming): C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\<AppName>
@@ -88,6 +92,10 @@
def user_data_dir(appname=None, appauthor=None, version=None, roaming=False):
path = os.path.expanduser('~/Library/Application Support/')
if appname:
path = os.path.join(path, appname)
+ if not os.path.isdir(path):
+ path = os.path.expanduser('~/.config/')
+ if appname:
+ path = os.path.join(path, appname)
else:
path = os.getenv('XDG_DATA_HOME', os.path.expanduser("~/.local/share"))
if appname:
@@ -150,7 +158,7 @@
def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
@@ -150,7 +154,7 @@
def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
if appname:
if version:
appname = os.path.join(appname, version)
...
...
@@ -42,7 +31,7 @@ index ae67001a..3a52b758 100644
if multipath:
path = os.pathsep.join(pathlist)
@@ -203,6 +2
11
,8 @@
def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
@@ -203,6 +2
03
,8 @@
def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
return path
...
...
@@ -51,7 +40,7 @@ index ae67001a..3a52b758 100644
def site_config_dir(appname=None, appauthor=None, version=None, multipath=False):
r"""Return full path to the user-shared data dir for this application.
@@ -238,14 +24
8
,15 @@
def site_config_dir(appname=None, appauthor=None, version=None, multipath=False)
@@ -238,14 +24
4
,15 @@
def site_config_dir(appname=None, appauthor=None, version=None, multipath=False)
if appname and version:
path = os.path.join(path, version)
else:
...
...
@@ -71,7 +60,7 @@ index ae67001a..3a52b758 100644
if multipath:
path = os.pathsep.join(pathlist)
@@ -291,6 +30
4
,10 @@
def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True):
@@ -291,6 +30
0
,10 @@
def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True):
if appauthor is None:
appauthor = appname
path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA"))
...
...
@@ -82,7 +71,7 @@ index ae67001a..3a52b758 100644
if appname:
if appauthor is not False:
path = os.path.join(path, appauthor, appname)
@@ -557,18 +57
4
,32 @@
def _get_win_folder_with_jna(csidl_name):
@@ -557,18 +57
0
,32 @@
def _get_win_folder_with_jna(csidl_name):
if system == "win32":
try:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录