Rework reparenting#737
Closed
tristanlatr wants to merge 4 commits into
Closed
Conversation
- Call handleDuplicate when re-exporting process introduces a new duplicate object.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #737 +/- ##
==========================================
+ Coverage 91.98% 92.77% +0.78%
==========================================
Files 47 47
Lines 8147 8245 +98
Branches 1780 1976 +196
==========================================
+ Hits 7494 7649 +155
+ Misses 380 340 -40
+ Partials 273 256 -17
☔ View full report in Codecov by Sentry. |
tristanlatr
commented
Sep 30, 2023
tristanlatr
commented
Sep 30, 2023
Contributor
Author
|
I'll close this PR since it makes more sens to merge an actual fix that builds on top of this PR. |
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.
Rework reparenting in post-processing. It ensures that for all time of visiting the ASTs, the model represent the real code structure, since no reparenting is done before post processing.
This patch changes some of the core pydoctor logic, so it should be carefully reviewed.
This changes will help fixing #295 as well as improve our capacity to fix #184 and other all related problems. Together with #723 it will finally fix #295.
Introduces the
Module.importsattribute holding a list of resolved imports (likeast.aliasbut with full module names), this is required by the re-exporting process since only imported names should be reparented.Introduces the
System.modulesattribute that is adictfrom the module full names to theModuleinstances. This dict is not changed during reparenting. It's populated when the modules are added to the system. This behaviour better matches the python import system and makes us differentiate a module vs an object with the same fullname as the module in the parent package__init__.pyfor instance.This PR should not introduce any changes in behaviour, except it fixes a bug in reparenting process when there as duplicates (see new tests).