-
-
Notifications
You must be signed in to change notification settings - Fork 439
Do not resolve all dependencies on add #3451
Replies: 1 comment · 3 replies
-
You are on the right track, but in reality, you must consider this situation. For example, But I admit that this method is somewhat brute and not very smart. so it brings performance penalty |
Beta Was this translation helpful? Give feedback.
All reactions
-
How about organize a dependency-version-range table at the first time, e.g., when you first {
"flask": {
"requires-python": ">=3.8",
"version-range": ">=2.0, <3.0",
"groups": ["default"]
},
"werkzeug": {
"requires-python": ">=3.9",
"version-range": ">=3.0",
"groups": ["default"]
}
} and when new package needs to be added, we directly look up the table. For example you input |
Beta Was this translation helpful? Give feedback.
All reactions
-
@frostming I do not agree with your explanation. See, I have library in version So let's install it and see output of PDM:
So what happened here is weird. Because dependecies of my_library are the same, PDM should only check libraries directly affected by updated one and as nothing wrong happened here (no version mismatch), should end the update. But as we can see in logs, PDM did much more verification which was not needed. |
Beta Was this translation helpful? Give feedback.
All reactions
-
@frostming I read the code and I understand that the current architecture does not allow for easy optimizations. As I see, the Resolver always works on all dependencies and based on the solution, a decision is made whether something should be removed or not. But your words are correct, this solution is quite brutal and slow. The Resolver does not know which dependency has been changed, it gets the whole list and tries to update them all. Due to this, PDM does a lot of unnecessary work when installing dependencies, which makes Based on this, I think that the Resolver should know what is happening, so it would be possible to introduce optimizations to not touch dependencies that are already satisfied. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
Right now, when I want to update/add one dependency I can see that PDM goes through all deps and tries to resolve everything once again.
Is there an option to skip that slow resolution?
What I mean is:
I have my packages:
And then I want to add my private beta package:
pdm add my-private-package==0.1.0b10
And then I'm seeing that PDM tries to resolve packages not related no newly installed one:
pdm.termui: Adding requirement SQLAlchemy>=1.4.0(from alembic 1.15.1)
Ok, so then I want to install 1.0.0 version of the same package:
pdm add my-private-package==1.0.0
And PDM goes once again with checking all dependencies even when
1.0.0
requirements haven't changed since0.1.0b10
Any reason to make so many checks when currently installed deps are already installed or is there a way to skip those checks somehow? To be honest it takes some time to resolve all of that right now.
Beta Was this translation helpful? Give feedback.
All reactions