Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Fix module cycle handling #1584

Closed
wants to merge 11 commits into from
Closed

Conversation

AlexanderSher
Copy link
Contributor

This change modifies the way we handle cycle dependencies of modules.
Previously, after finding the loop, we have determined some random path to walk over those modules and walked twice over it. With new approach, we first collect information about location of imports and variables in global scope of the modules in the loop, and then try to find a starting module. After that, we do the analysis starting from that module. Analyzes for modules are saved only after they are obtained for all modules in the loop.

# Conflicts:
#	src/Analysis/Ast/Impl/Analyzer/PythonAnalyzerSession.cs
#	src/Analysis/Ast/Impl/Dependencies/DependencyResolver.cs
@AlexanderSher
Copy link
Contributor Author

Please don't merge the PR until 9/30, I'd like to run the tests on my main machine.

@MikhailArkhipov
Copy link

Most probably conflicts with #1565 which changed how variables/members are exposed from variable modules.

@MikhailArkhipov
Copy link

MikhailArkhipov commented Sep 26, 2019

In the PR branch:

  • Running analysis tests, LibraryTests.Requests failed consistently.
  • In the app tests in full-cache mode "python.analysis.cachingLevel": "Library" only some of the numpy modules were saved so on reload analysis still took time.

image

  • In partial-cache mode "python.analysis.cachingLevel": "System" results do appear consistently the same.

# Conflicts:
#	src/Analysis/Ast/Impl/Analyzer/Handlers/FromImportHandler.cs
#	src/Analysis/Ast/Impl/Analyzer/Handlers/ImportHandler.cs
# Conflicts:
#	src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs
#	src/Analysis/Ast/Impl/Modules/PythonVariableModule.cs
#	src/Analysis/Ast/Impl/Modules/Resolution/ModuleResolutionBase.cs
@MikhailArkhipov
Copy link

Reopen from another branch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants