Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
765f6025
P
Pdm
项目概览
后端镜像
/
Pdm
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pdm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
765f6025
编写于
6月 12, 2020
作者:
F
Frost Ming
提交者:
GitHub
6月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #125 from frostming/upgrade-pip
Upgrade pip
上级
c056a5ba
33106e64
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
171 addition
and
144 deletion
+171
-144
news/125.dep
news/125.dep
+1
-0
pdm.lock
pdm.lock
+115
-119
pdm/core.py
pdm/core.py
+4
-1
pdm/formats/requirements.py
pdm/formats/requirements.py
+6
-1
pdm/models/environment.py
pdm/models/environment.py
+18
-19
pdm/utils.py
pdm/utils.py
+17
-1
pyproject.toml
pyproject.toml
+1
-1
setup_dev.py
setup_dev.py
+1
-1
tests/cli/test_actions.py
tests/cli/test_actions.py
+0
-1
tests/conftest.py
tests/conftest.py
+8
-0
未找到文件。
news/125.dep
0 → 100644
浏览文件 @
765f6025
Upgrade dependency `pip` to `20.1`.
pdm.lock
浏览文件 @
765f6025
此差异已折叠。
点击以展开。
pdm/core.py
浏览文件 @
765f6025
...
...
@@ -69,6 +69,8 @@ class Core:
def
main
(
self
,
args
=
None
,
prog_name
=
None
,
obj
=
None
,
**
extra
):
"""The main entry function"""
from
pip._internal.utils.temp_dir
import
global_tempdir_manager
self
.
init_parser
()
self
.
load_plugins
()
...
...
@@ -93,7 +95,8 @@ class Core:
sys
.
exit
(
1
)
else
:
try
:
f
(
options
.
project
,
options
)
with
global_tempdir_manager
():
f
(
options
.
project
,
options
)
except
Exception
:
etype
,
err
,
traceback
=
sys
.
exc_info
()
if
stream
.
verbosity
>
stream
.
NORMAL
:
...
...
pdm/formats/requirements.py
浏览文件 @
765f6025
...
...
@@ -55,8 +55,13 @@ def requirement_from_ireq(ireq):
def
parse_requirement_file
(
filename
):
from
pip._internal.req.constructors
import
install_req_from_parsed_requirement
finder
=
get_finder
([])
ireqs
=
list
(
parse_requirements
(
filename
,
finder
.
session
,
finder
))
ireqs
=
[
install_req_from_parsed_requirement
(
pr
)
for
pr
in
parse_requirements
(
filename
,
finder
.
session
,
finder
)
]
return
ireqs
,
finder
...
...
pdm/models/environment.py
浏览文件 @
765f6025
...
...
@@ -31,6 +31,7 @@ from pdm.utils import (
get_python_version
,
get_sys_config_paths
,
get_venv_python
,
populate_link
,
temp_environ
,
)
...
...
@@ -272,7 +273,6 @@ class Environment:
:param allow_all: Allow building incompatible wheels.
:returns: The full path of the built artifact.
"""
from
pip._internal.utils.temp_dir
import
global_tempdir_manager
from
pdm.builders
import
EditableBuilder
from
pdm.builders
import
WheelBuilder
...
...
@@ -281,9 +281,9 @@ class Environment:
if
allow_all
:
with
allow_all_wheels
():
# temporarily allow all wheels to get a link.
ireq
.
populate_link
(
finder
,
False
,
bool
(
hashes
)
)
populate_link
(
finder
,
ireq
,
False
)
else
:
ireq
.
populate_link
(
finder
,
False
,
bool
(
hashes
)
)
populate_link
(
finder
,
ireq
,
False
)
if
not
ireq
.
editable
and
not
ireq
.
req
.
name
:
ireq
.
source_dir
=
kwargs
[
"build_dir"
]
else
:
...
...
@@ -295,23 +295,22 @@ class Environment:
download_dir
=
kwargs
[
"wheel_download_dir"
]
only_download
=
True
if
hashes
:
ireq
.
options
[
"hashes"
]
=
convert_hashes
(
hashes
)
ireq
.
hash_options
=
convert_hashes
(
hashes
)
if
not
(
ireq
.
editable
and
ireq
.
req
.
is_local_dir
):
with
global_tempdir_manager
():
downloader
=
shims
.
Downloader
(
finder
.
session
,
"off"
)
downloaded
=
shims
.
unpack_url
(
ireq
.
link
,
ireq
.
source_dir
,
downloader
,
download_dir
,
ireq
.
hashes
(
False
),
)
# Preserve the downloaded file so that it won't be cleared.
if
downloaded
and
only_download
:
try
:
shutil
.
copy
(
downloaded
,
download_dir
)
except
shutil
.
SameFileError
:
pass
downloader
=
shims
.
Downloader
(
finder
.
session
,
"off"
)
downloaded
=
shims
.
unpack_url
(
ireq
.
link
,
ireq
.
source_dir
,
downloader
,
download_dir
,
ireq
.
hashes
(
False
),
)
# Preserve the downloaded file so that it won't be cleared.
if
downloaded
and
only_download
:
try
:
shutil
.
copy
(
downloaded
.
path
,
download_dir
)
except
shutil
.
SameFileError
:
pass
# Now all source is prepared, build it.
if
ireq
.
link
.
is_wheel
:
return
(
self
.
project
.
cache
(
"wheels"
)
/
ireq
.
link
.
filename
).
as_posix
()
...
...
pdm/utils.py
浏览文件 @
765f6025
...
...
@@ -19,7 +19,13 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
from
distlib.wheel
import
Wheel
from
packaging.version
import
parse
as
parse_version
from
pip_shims.shims
import
InstallCommand
,
PackageFinder
,
TargetPython
,
url_to_path
from
pip_shims.shims
import
(
InstallCommand
,
InstallRequirement
,
PackageFinder
,
TargetPython
,
url_to_path
,
)
from
pdm._types
import
Source
...
...
@@ -506,3 +512,13 @@ def get_platform():
def
highest_version
(
versions
:
List
[
str
])
->
str
:
"""Return the highest version of a given list."""
return
max
(
versions
,
key
=
parse_version
)
def
populate_link
(
finder
:
PackageFinder
,
ireq
:
InstallRequirement
,
upgrade
:
bool
=
False
):
"""Populate ireq's link attribute"""
if
ireq
.
link
:
return
link
=
finder
.
find_requirement
(
ireq
,
upgrade
)
ireq
.
link
=
link
pyproject.toml
浏览文件 @
765f6025
...
...
@@ -27,7 +27,7 @@ Documentation = "https://pdm.fming.dev"
appdirs
=
"*"
click
=
"*"
distlib
=
"*"
pip
=
"
<20.1,>=20.0
"
pip
=
"
>=20.1
"
pip_shims
=
"*"
pythonfinder
=
"*"
tomlkit
=
"*"
...
...
setup_dev.py
浏览文件 @
765f6025
...
...
@@ -26,7 +26,7 @@ def main():
print
(
"Installing base requirements..."
,
flush
=
True
)
subprocess
.
check_call
(
[
venv_python
.
as_posix
(),
"-m"
,
"pip"
,
"install"
,
"-U"
,
"pip
<20.1
"
,
"pdm"
]
[
venv_python
.
as_posix
(),
"-m"
,
"pip"
,
"install"
,
"-U"
,
"pip"
,
"pdm"
]
)
print
(
"Setup project for development..."
,
flush
=
True
)
...
...
tests/cli/test_actions.py
浏览文件 @
765f6025
...
...
@@ -369,7 +369,6 @@ def test_list_dependency_graph(capsys):
actions
.
do_list
(
project
,
True
)
content
,
_
=
capsys
.
readouterr
()
assert
"halo 0.0.29 [ required: <1.0.0,>=0.0.28 ]"
in
content
assert
"six 1.14.0 [ required: >=1.12.0 ]"
in
content
def
test_list_dependency_graph_with_circular
(
project
,
capsys
,
repository
,
working_set
):
...
...
tests/conftest.py
浏览文件 @
765f6025
...
...
@@ -243,6 +243,14 @@ def get_local_finder(*args, **kwargs):
return
finder
@
pytest
.
fixture
(
autouse
=
True
)
def
pip_global_tempdir_manager
():
from
pip._internal.utils.temp_dir
import
global_tempdir_manager
with
global_tempdir_manager
():
yield
@
pytest
.
fixture
()
def
project_no_init
(
tmp_path
,
mocker
):
p
=
TestProject
(
tmp_path
.
as_posix
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录