Replies: 1 comment
-
This issue might provide some insight?:
Local file deps are not cached (that said, even with PyTorch index, there is some odd observation with the I assume the internal behaviour discussed at the linked issue is related to the problem you're facing. Alternatively, I have also observed with the "local identifier" portion (
Your output also seems to hint that it's getting confused there. Do you have the same issue with local |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Now here's the simplest case: there are three local whl dependencies in the project config file.
现在有如下一个最简单的场景:项目里有三个本地的依赖,以whl的形式安装.
platform: Windows 10 22H2, Python 3.10.
测试的环境为 Windows 10 22H2,Python 3.10
Then we run pdm install to create, lock, install the virtual environment, and so on.
然后我们通过 pdm install 完成了虚拟环境创建、lock、安装 等等.
Question
Now we want to install a new dependency from pypi, such as loguru, use
pdm add loguru
, and the following output will show:这时候我们想要在线安装一个新的依赖,例如loguru ,我们运行
pdm add loguru
, 还能看到如下输出:It seems that pdm has installed these three local dependencies again! This confuses me as my local whl file has not changed and the pdm.lock file previously recorded the sha256 of all three files can automatically verify this.
似乎pdm又安装了一次这三个本地依赖,这使我很困惑,因为我本地whl文件未曾改变,pdm.lock文件也早已记录了这三个文件的sha256可以确认这一点。
Packages that we install from pypi, such as loguru above, will not be installed again by the
pdm add ...
andpdm install
.比如我们在线安装的包,比如上面安装的 loguru 在之后的 add install 指令中不会再次触发被安装.
For example, if we add the
tenacity
, we will get the following output, loguru is not installed or updated比如我们再添加 tenacity 这个依赖,会得到以下输出,看起来loguru没有被安装或者更新,而这三个本地依赖再次被“更新”:
Effect
All commands involving dependencies (changes),
add
,install
,remove
, and so on. All seem to reinstall the local whl, which is more time-consuming with a large number of local whl deps.所有涉及依赖(变化)的指令,
add
install
remove
... 似乎都会重新安装本地的whl,这在大量本地whl的情况下比较耗时.With only the above three local whl deps., measuring the time of
pdm add tenacity
via powershell'sMeasure-Command
(Measure-Command {pdm add tenacity}
) .在仅有上述三个本地whl的情况下,通过通过 powershell的
Measure-Command
测量pdm add tenacity
的运行时间 即Measure-Command {pdm add tenacity}
.We got
TotalSeconds : 93.6240561
得到
TotalSeconds : 93.6240561
If we remove these three local whl deps. from
pyproject.toml
and measure the time ofpdm add tenacity
again.如果从
pyproject.toml
中删除这三个本地 whl,再次测量pdm add tenacity
的运行时间.We got
TotalSeconds : 1.6638713
得到
TotalSeconds : 1.6638713
Discussion
Testing on Windows only may not be comprehensive enough, not sure if this is an issue with my own configuration.
只在Windows上进行测试可能不够全面,不确定这是不是我自己配置的问题。
I'm wondering if there's some way to bypass or mitigate this issue for cases where there are a lot of local whl deps. ?
我想知道对于本地有很多whl的情况下,是不是有什么方法绕过或者缓解这个问题?
Is this a flaw in the implementation or a compromise? Interested in the reason.
这是否是实现上的(可能没这么严重)瑕疵或者妥协? 对此很感兴趣
THANK YOU for reading 🙏
感谢你读到这里🙏
Beta Was this translation helpful? Give feedback.
All reactions