Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
63fa7b5b
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,发现更多精彩内容 >>
未验证
提交
63fa7b5b
编写于
3月 28, 2020
作者:
F
Frost Ming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update pdm dependencies
上级
07a3871b
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
232 addition
and
242 deletion
+232
-242
news/89.dep
news/89.dep
+2
-0
pdm.lock
pdm.lock
+137
-221
pdm/installers.py
pdm/installers.py
+1
-1
pdm/models/caches.py
pdm/models/caches.py
+1
-1
pdm/models/environment.py
pdm/models/environment.py
+5
-6
pdm/project/core.py
pdm/project/core.py
+6
-2
pdm/project/meta.py
pdm/project/meta.py
+2
-2
pdm/utils.py
pdm/utils.py
+65
-2
pyproject.toml
pyproject.toml
+0
-1
setup.cfg
setup.cfg
+0
-1
setup_dev.py
setup_dev.py
+10
-1
tests/cli/test_actions.py
tests/cli/test_actions.py
+1
-1
tests/cli/test_cli.py
tests/cli/test_cli.py
+1
-2
tests/test_project.py
tests/test_project.py
+1
-1
未找到文件。
news/89.dep
0 → 100644
浏览文件 @
63fa7b5b
Update dependencies `pythonfinder`, `python-cfonts`, `pip-shims` and many others.
Drop dependency `vistir`.
pdm.lock
浏览文件 @
63fa7b5b
此差异已折叠。
点击以展开。
pdm/installers.py
浏览文件 @
63fa7b5b
...
...
@@ -14,13 +14,13 @@ from distlib.wheel import Wheel
from
pip._internal.utils
import
logging
as
pip_logging
from
pip._vendor.pkg_resources
import
Distribution
,
EggInfoDistribution
,
safe_name
from
pip_shims
import
shims
from
vistir
import
cd
from
pdm.exceptions
import
InstallationError
from
pdm.iostream
import
stream
from
pdm.models.candidates
import
Candidate
from
pdm.models.environment
import
Environment
from
pdm.models.requirements
import
parse_requirement
,
strip_extras
from
pdm.utils
import
cd
def
_is_dist_editable
(
dist
:
Distribution
)
->
bool
:
...
...
pdm/models/caches.py
浏览文件 @
63fa7b5b
...
...
@@ -5,10 +5,10 @@ from typing import TYPE_CHECKING, Any, Dict, Optional
import
pip_shims
from
pip._vendor
import
requests
from
vistir.contextmanagers
import
open_file
from
pdm._types
import
CandidateInfo
from
pdm.exceptions
import
CorruptedCacheError
from
pdm.utils
import
open_file
if
TYPE_CHECKING
:
from
pdm.models.candidates
import
Candidate
...
...
pdm/models/environment.py
浏览文件 @
63fa7b5b
...
...
@@ -15,8 +15,6 @@ from pip._vendor import packaging, pkg_resources
from
pip_shims
import
shims
from
pythonfinder
import
Finder
from
pythonfinder.environment
import
PYENV_INSTALLED
,
PYENV_ROOT
from
vistir.contextmanagers
import
temp_environ
from
vistir.path
import
normalize_path
from
pdm.exceptions
import
NoPythonVersion
from
pdm.iostream
import
stream
...
...
@@ -31,6 +29,7 @@ from pdm.utils import (
get_python_version
,
get_sys_config_paths
,
get_venv_python
,
temp_environ
,
)
if
TYPE_CHECKING
:
...
...
@@ -181,8 +180,8 @@ class Environment:
def
is_local
(
self
,
path
)
->
bool
:
"""PEP 582 version of ``is_local()`` function."""
return
normalize_path
(
path
).
startswith
(
normalize_path
(
self
.
packages_path
.
as_posix
())
return
misc
.
normalize_path
(
path
).
startswith
(
misc
.
normalize_path
(
self
.
packages_path
.
as_posix
())
)
def
evaluate_marker
(
self
,
text
:
str
,
extra
=
None
)
->
bool
:
...
...
@@ -356,8 +355,8 @@ class GlobalEnvironment(Environment):
return
paths
def
is_local
(
self
,
path
)
->
bool
:
return
normalize_path
(
path
).
startswith
(
normalize_path
(
self
.
get_paths
()[
"prefix"
])
return
misc
.
normalize_path
(
path
).
startswith
(
misc
.
normalize_path
(
self
.
get_paths
()[
"prefix"
])
)
@
property
...
...
pdm/project/core.py
浏览文件 @
63fa7b5b
...
...
@@ -11,7 +11,6 @@ import halo
import
tomlkit
from
pip._vendor.pkg_resources
import
safe_name
from
pip_shims
import
shims
from
vistir.contextmanagers
import
atomic_open_for_write
from
pdm._types
import
Source
from
pdm.exceptions
import
ProjectError
...
...
@@ -26,7 +25,12 @@ from pdm.project.config import Config
from
pdm.project.meta
import
PackageMeta
from
pdm.resolver
import
BaseProvider
,
EagerUpdateProvider
,
ReusePinProvider
from
pdm.resolver.reporters
import
SpinnerReporter
from
pdm.utils
import
cached_property
,
find_project_root
,
get_venv_python
from
pdm.utils
import
(
atomic_open_for_write
,
cached_property
,
find_project_root
,
get_venv_python
,
)
if
TYPE_CHECKING
:
from
tomlkit.container
import
Container
...
...
pdm/project/meta.py
浏览文件 @
63fa7b5b
...
...
@@ -6,11 +6,11 @@ import re
from
typing
import
TYPE_CHECKING
,
Dict
,
List
,
Union
import
setuptools
import
vistir
from
pkg_resources
import
safe_name
from
pdm.exceptions
import
ProjectError
from
pdm.models.markers
import
Marker
from
pdm.utils
import
cd
if
TYPE_CHECKING
:
from
pdm.project
import
Project
...
...
@@ -148,7 +148,7 @@ class PackageMeta:
package_data
=
{
""
:
[
"*"
]}
exclude_package_data
=
{}
with
vistir
.
cd
(
self
.
project
.
root
.
as_posix
()):
with
cd
(
self
.
project
.
root
.
as_posix
()):
if
not
self
.
includes
:
if
os
.
path
.
isdir
(
"src"
):
package_dir
[
""
]
=
"src"
...
...
pdm/utils.py
浏览文件 @
63fa7b5b
...
...
@@ -14,10 +14,10 @@ import tempfile
import
urllib.parse
as
parse
from
contextlib
import
contextmanager
from
pathlib
import
Path
from
typing
import
TYPE_CHECKING
,
Any
,
Dict
,
List
,
Optional
,
Tuple
from
typing
import
TYPE_CHECKING
,
Any
,
Dict
,
List
,
Optional
,
Tuple
,
Union
from
distlib.wheel
import
Wheel
from
pip_shims.shims
import
InstallCommand
,
PackageFinder
,
TargetPython
from
pip_shims.shims
import
InstallCommand
,
PackageFinder
,
TargetPython
,
url_to_path
from
pdm._types
import
Source
...
...
@@ -418,3 +418,66 @@ def get_venv_python() -> Optional[str]:
suffix
=
""
scripts
=
"bin"
return
os
.
path
.
join
(
venv
,
scripts
,
f
"python
{
suffix
}
"
)
@
contextmanager
def
atomic_open_for_write
(
filename
:
Union
[
Path
,
str
],
*
,
encoding
:
str
=
"utf-8"
):
fd
,
name
=
tempfile
.
mkstemp
(
"-atomic-write"
,
"pdm-"
)
try
:
f
=
open
(
fd
,
"w"
,
encoding
=
encoding
)
yield
f
except
Exception
:
f
.
close
()
os
.
unlink
(
name
)
raise
else
:
f
.
close
()
try
:
os
.
unlink
(
filename
)
except
OSError
:
pass
os
.
rename
(
name
,
filename
)
@
contextmanager
def
cd
(
path
:
str
):
_old_cwd
=
os
.
getcwd
()
os
.
chdir
(
path
)
try
:
yield
finally
:
os
.
chdir
(
_old_cwd
)
@
contextmanager
def
temp_environ
():
environ
=
os
.
environ
.
copy
()
try
:
yield
finally
:
os
.
environ
.
clear
()
os
.
environ
.
update
(
environ
)
@
contextmanager
def
open_file
(
url
,
session
=
None
):
if
url
.
startswith
(
"file://"
):
local_path
=
url_to_path
(
url
)
if
os
.
path
.
isdir
(
local_path
):
raise
ValueError
(
"Cannot open directory for read: {}"
.
format
(
url
))
else
:
with
open
(
local_path
,
"rb"
)
as
local_file
:
yield
local_file
else
:
headers
=
{
"Accept-Encoding"
:
"identity"
}
with
session
.
get
(
url
,
headers
=
headers
,
stream
=
True
)
as
resp
:
try
:
raw
=
getattr
(
resp
,
"raw"
,
None
)
result
=
raw
if
raw
else
resp
yield
result
finally
:
if
raw
:
conn
=
getattr
(
raw
,
"_connection"
)
if
conn
is
not
None
:
conn
.
close
()
result
.
close
()
pyproject.toml
浏览文件 @
63fa7b5b
...
...
@@ -39,7 +39,6 @@ pytest = "*"
pytest-cov
=
"*"
pytest-mock
=
"*"
towncrier
=
"<20.0.0,>=19.2.0"
pytest-sugar
=
"<1.0.0,>=0.9.2"
pytest-xdist
=
"<2.0.0,>=1.31.0"
[tool.pdm.doc-dependencies]
...
...
setup.cfg
浏览文件 @
63fa7b5b
...
...
@@ -46,7 +46,6 @@ known_first_party = pdm
known_third_party =
click
halo
vistir
distlib
pythonfinder
pytest
...
...
setup_dev.py
浏览文件 @
63fa7b5b
...
...
@@ -28,7 +28,16 @@ def main():
subprocess
.
check_call
([
venv_python
.
as_posix
(),
"-m"
,
"pip"
,
"install"
,
"pdm"
])
subprocess
.
check_call
(
[
venv_python
.
as_posix
(),
"-m"
,
"pip"
,
"install"
,
"pip"
,
"pip_shims"
,
"-U"
]
[
venv_python
.
as_posix
(),
"-m"
,
"pip"
,
"install"
,
"-U"
,
"pip"
,
"pip_shims"
,
"vistir"
,
]
)
print
(
"Setup project for development..."
,
flush
=
True
)
...
...
tests/cli/test_actions.py
浏览文件 @
63fa7b5b
...
...
@@ -357,7 +357,7 @@ def test_list_dependency_graph(capsys):
project
=
Project
()
actions
.
do_list
(
project
,
True
)
content
,
_
=
capsys
.
readouterr
()
assert
"halo 0.0.2
8
[ required: <1.0.0,>=0.0.28 ]"
in
content
assert
"halo 0.0.2
9
[ required: <1.0.0,>=0.0.28 ]"
in
content
assert
"six 1.14.0 [ required: >=1.12.0 ]"
in
content
...
...
tests/cli/test_cli.py
浏览文件 @
63fa7b5b
...
...
@@ -4,11 +4,10 @@ import sys
from
pathlib
import
Path
import
pytest
from
vistir.contextmanagers
import
temp_environ
from
pdm.cli
import
actions
from
pdm.models.requirements
import
parse_requirement
from
pdm.utils
import
get_python_version
from
pdm.utils
import
get_python_version
,
temp_environ
def
test_help_option
(
invoke
):
...
...
tests/test_project.py
浏览文件 @
63fa7b5b
...
...
@@ -2,9 +2,9 @@ import os
from
pathlib
import
Path
import
pytest
from
vistir
import
temp_environ
from
pdm.project
import
Project
from
pdm.utils
import
temp_environ
def
test_project_python_with_pyenv_support
(
project
,
mocker
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录