Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
d22f0cf0
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,发现更多精彩内容 >>
未验证
提交
d22f0cf0
编写于
1月 28, 2021
作者:
F
Frost Ming
提交者:
GitHub
1月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #244 from frostming/feature/egg-info
rewrite the egg info when dependencies change
上级
65183d66
ca22aa11
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
1 deletion
+18
-1
news/240.feature
news/240.feature
+1
-0
pdm/installers/synchronizers.py
pdm/installers/synchronizers.py
+16
-0
pdm/models/builders.py
pdm/models/builders.py
+1
-1
未找到文件。
news/240.feature
0 → 100644
浏览文件 @
d22f0cf0
Rewrite
the
project's
`egg-info`
directory
when
dependencies
change.
So
that
`pdm
list
--graph`
won't
show
invalid
entries.
pdm/installers/synchronizers.py
浏览文件 @
d22f0cf0
...
...
@@ -10,6 +10,7 @@ from pip._vendor.pkg_resources import Distribution, safe_name
from
pdm.exceptions
import
InstallationError
from
pdm.installers.installers
import
Installer
,
is_dist_editable
from
pdm.iostream
import
CELE
,
stream
from
pdm.models.builders
import
EnvBuilder
from
pdm.models.candidates
import
Candidate
from
pdm.models.environment
import
Environment
from
pdm.models.requirements
import
strip_extras
...
...
@@ -90,6 +91,16 @@ class Synchronizer:
except
KeyboardInterrupt
:
pass
def
update_project_egg_info
(
self
):
canonical_name
=
self
.
environment
.
project
.
meta
.
project_name
.
lower
().
replace
(
"-"
,
"_"
)
egg_info_dir
=
self
.
environment
.
project
.
root
/
f
"
{
canonical_name
}
.egg-info"
if
egg_info_dir
.
exists
():
stream
.
echo
(
"Updating the project's egg info..."
)
with
EnvBuilder
(
self
.
environment
.
project
.
root
,
self
.
environment
)
as
builder
:
builder
.
build_egg_info
(
str
(
builder
.
src_dir
))
def
get_installer
(
self
)
->
Installer
:
return
Installer
(
self
.
environment
)
...
...
@@ -238,6 +249,9 @@ class Synchronizer:
stream
.
echo
(
stream
.
yellow
(
"All packages are synced to date, nothing to do."
)
)
if
not
dry_run
:
with
stream
.
logging
(
"install"
):
self
.
update_project_egg_info
()
return
to_do
=
{
"remove"
:
to_remove
,
"update"
:
to_update
,
"add"
:
to_add
}
self
.
_show_headline
(
to_do
)
...
...
@@ -313,4 +327,6 @@ class Synchronizer:
stream
.
echo
(
"Installing the project as an editable package..."
)
with
stream
.
indent
(
" "
):
handlers
[
install_self
[
0
]](
install_self
[
1
])
else
:
self
.
update_project_egg_info
()
stream
.
echo
(
f
"
\n
{
CELE
}
All complete!"
)
pdm/models/builders.py
浏览文件 @
d22f0cf0
...
...
@@ -265,7 +265,7 @@ class EnvBuilder:
setup_py_path
=
builder
.
ensure_setup_py
().
as_posix
()
self
.
install
([
"setuptools"
])
args
=
[
self
.
executable
,
"-c"
,
_SETUPTOOLS_SHIM
.
format
(
setup_py_path
)]
args
.
extend
([
"egg_info"
,
"--egg-base"
,
o
ut_dir
])
args
.
extend
([
"egg_info"
,
"--egg-base"
,
o
s
.
path
.
relpath
(
out_dir
,
self
.
src_dir
)
])
self
.
subprocess_runner
(
args
,
cwd
=
self
.
src_dir
)
filename
=
_find_egg_info
(
out_dir
)
return
os
.
path
.
join
(
out_dir
,
filename
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录