Commit aeec899d authored by Anton Bragin's avatar Anton Bragin
Browse files

PY-28321 Revert source root order for imports

The commit reverts source root order respect for import statements thus
reopening PY-28321. The reason is that until pkg_resources and pkgutil
namespace packages are not implemented (see PY-16688, PY-23087) the
original fix leads to false positives in projects relying on this
functionality.

As soon as namespace packages support via pkg_resources and pkgutil will
 be implemented the change should be reverted back to close PY-28321.
parent 740609a0
Branches unavailable Tags unavailable
No related merge requests found
Showing with 4 additions and 2 deletions
+4 -2
......@@ -101,7 +101,8 @@ private fun resolveQualifiedName(name: QualifiedName,
val foreignResults = foreignResults(name, context)
val pythonResults = listOf(relativeResults,
resolveFromRoots(name, context),
// TODO: replace with resolveFromRoots when namespace package magic features PY-16688, PY-23087 are implemented
resultsFromRoots(name, context),
relativeResultsFromSkeletons(name, context)).flatten().distinct()
val allResults = pythonResults + foreignResults
val results = if (name.componentCount > 0) findFirstResults(pythonResults, context.module) + foreignResults else allResults
......
......@@ -467,7 +467,8 @@ public class PyMultiFileResolveTest extends PyMultiFileResolveTestCase {
}
// PY-28321
public void testImportManySourceRootsReverseRootOrder() {
// TODO: The test should be turned on as soon as PY-16688 and PY-23087 are implemented
public void ignoreTestImportManySourceRootsReverseRootOrder() {
myFixture.copyDirectoryToProject("importManySourceRoots", "");
runWithSourceRoots(Lists.newArrayList(myFixture.findFileInTempDir("root1"), myFixture.findFileInTempDir("root2")), () -> {
final PsiFile psiFile = myFixture.configureByFile("root1/pkg/a.py");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment