replace clone to clone_shallow and copy only as much as you need attributes.#618
Closed
higumachan wants to merge 4 commits intopython-poetry:mainfrom
Closed
replace clone to clone_shallow and copy only as much as you need attributes.#618higumachan wants to merge 4 commits intopython-poetry:mainfrom
higumachan wants to merge 4 commits intopython-poetry:mainfrom
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Contributor
|
@mtkennerly you have misunderstood this MR, it has nothing at all to do with git clone |
|
Ah, sorry, you're absolutely right. Carry on 😅 |
|
Kudos, SonarCloud Quality Gate passed!
|
|
Kudos, SonarCloud Quality Gate passed!
|
Contributor
|
Did you run a profiler to know if this fix the issue? |
eamanu
reviewed
Nov 13, 2023
| """ | ||
| package = self.clone() | ||
| package = self.clone_shallow() | ||
| package._dependency_groups = package._dependency_groups.copy() |
Contributor
There was a problem hiding this comment.
a little comment explaining why we are copying the package._depndency_groups wouldbe great
Member
|
Superseded by #663. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Resolves: python-poetry#8250
Description
This change was made under the assumption that if the tests pass, there should be no problem. However, just replacing the clone with a shallow copy caused several tests to fail, so I made "one level deeper" copies sufficient to fix those tests.
I understand that there is a trade-off with code maintainability regarding this change, so I would appreciate some feedback.
If we are to implement this while ensuring future changeability, I think we could solve this by creating code similar to Cow (Copy on Write).
Thanks.