Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
c9ce9f5a
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,发现更多精彩内容 >>
未验证
提交
c9ce9f5a
编写于
3月 08, 2020
作者:
F
Frost Ming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix python version subset check
上级
9a562840
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
3 deletion
+20
-3
news/66.bugfix
news/66.bugfix
+1
-0
news/67.feature
news/67.feature
+1
-0
pdm/cli/actions.py
pdm/cli/actions.py
+2
-2
pdm/cli/commands.py
pdm/cli/commands.py
+3
-1
pdm/models/specifiers.py
pdm/models/specifiers.py
+7
-0
tests/resolver/test_resolve.py
tests/resolver/test_resolve.py
+6
-0
未找到文件。
news/66.bugfix
0 → 100644
浏览文件 @
c9ce9f5a
Regard `4.0` as infinite upper bound when checking subsetting.
news/67.feature
0 → 100644
浏览文件 @
c9ce9f5a
Display
all
availible
Python
interpreters
if
users
don't
give
on
in
`pdm
init`.
pdm/cli/actions.py
浏览文件 @
c9ce9f5a
...
...
@@ -447,7 +447,7 @@ def do_use(project: Project, python: str, first: bool = False) -> None:
"""Use the specified python version and save in project config.
The python can be a version string or interpreter path.
"""
if
not
all
(
c
.
isdigit
()
for
c
in
python
.
split
(
"."
)):
if
python
and
not
all
(
c
.
isdigit
()
for
c
in
python
.
split
(
"."
)):
if
Path
(
python
).
exists
():
python_path
=
Path
(
python
).
absolute
().
as_posix
()
else
:
...
...
@@ -458,7 +458,7 @@ def do_use(project: Project, python: str, first: bool = False) -> None:
else
:
finder
=
pythonfinder
.
Finder
()
pythons
=
[]
args
=
[
int
(
v
)
for
v
in
python
.
split
(
"."
)]
args
=
[
int
(
v
)
for
v
in
python
.
split
(
"."
)
if
v
!=
""
]
for
i
,
entry
in
enumerate
(
finder
.
find_all_python_versions
(
*
args
)):
python_version
=
get_python_version
(
entry
.
path
.
as_posix
(),
True
)
pythons
.
append
((
entry
.
path
.
as_posix
(),
python_version
))
...
...
pdm/cli/commands.py
浏览文件 @
c9ce9f5a
...
...
@@ -289,7 +289,9 @@ def build(project, sdist, wheel, dest, clean):
@
pass_project
def
init
(
project
):
"""Initialize a pyproject.toml for PDM."""
python
=
click
.
prompt
(
"Please enter the Python interpreter to use"
)
python
=
click
.
prompt
(
"Please enter the Python interpreter to use"
,
default
=
""
,
show_default
=
False
)
actions
.
do_use
(
project
,
python
)
if
project
.
pyproject_file
.
exists
():
...
...
pdm/models/specifiers.py
浏览文件 @
c9ce9f5a
...
...
@@ -86,6 +86,7 @@ class PySpecSet(SpecifierSet):
(
3
,
6
):
10
,
(
3
,
7
):
6
,
}
MAX_MAJOR_VERSION
=
4
MIN_VERSION
=
(
-
1
,
-
1
,
-
1
)
MAX_VERSION
=
(
99
,
99
,
99
)
...
...
@@ -381,6 +382,10 @@ class PySpecSet(SpecifierSet):
if
self
.
is_allow_all
:
return
True
other
=
type
(
self
)(
str
(
other
))
if
other
.
_upper_bound
[
0
]
>=
self
.
MAX_MAJOR_VERSION
:
# XXX: narrow down the upper bound to ``MAX_MAJOR_VERSION``
# So that `>=3.6,<4.0` is considered a superset of `>=3.7`, see issues/66
other
.
_upper_bound
=
(
self
.
MAX_MAJOR_VERSION
,
0
,
0
)
if
(
self
.
_lower_bound
>
other
.
_lower_bound
or
self
.
_upper_bound
<
other
.
_upper_bound
...
...
@@ -398,6 +403,8 @@ class PySpecSet(SpecifierSet):
if
self
.
is_impossible
:
return
False
other
=
type
(
self
)(
str
(
other
))
if
other
.
_upper_bound
[
0
]
>=
self
.
MAX_MAJOR_VERSION
:
other
.
_upper_bound
=
self
.
MAX_VERSION
if
other
.
is_allow_all
:
return
True
if
(
...
...
tests/resolver/test_resolve.py
浏览文件 @
c9ce9f5a
...
...
@@ -200,3 +200,9 @@ def test_resolve_two_extras_from_the_same_package(project, repository):
result
=
resolve_requirements
(
repository
,
[
line
])
assert
"pysocks"
in
result
assert
"pyopenssl"
in
result
def
test_resolve_package_with_dummy_upbound
(
project
,
repository
):
repository
.
add_candidate
(
"foo"
,
"0.1.0"
,
">=3.6,<4.0"
)
result
=
resolve_requirements
(
repository
,
[
"foo"
],
">=3.5"
)
assert
"foo"
in
result
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录