PY-44858 Move and other refactorings don't introduce __init__.py inside namespace packages

Namely, Move Module Members, Extract Superclass and Make Local Function Top-Level were
all affected by this.
Now we check if the refactoring origin is inside a namespace package to decide whether
__init__.py should be generated for target directories.

Co-authored-by: Kamalia <alishevakamalia@gmail.com>
Co-authored-by: Maksim.Levitskii <maksim.levitskii@jetbrains.com>

GitOrigin-RevId: b0b3420c5ec8d1f7d3000d8834211631690a0c42
This commit is contained in:
maxle
2024-05-02 18:54:52 +03:00
committed by intellij-monorepo-bot
parent 128ac0ba66
commit 90bbc21f3f
49 changed files with 363 additions and 117 deletions

View File

@@ -0,0 +1,7 @@
from b.suppa import Suppa
class Foo(Suppa):
def bar(self):
print("foo")

View File

@@ -0,0 +1,3 @@
class Suppa:
def foo(self):
print("bar")

View File

@@ -0,0 +1,6 @@
class Foo:
def bar(self):
print("foo")
def foo(self):
print("bar")

View File

@@ -0,0 +1,7 @@
from b.suppa import Suppa
class Foo(Suppa):
def bar(self):
print("foo")

View File

@@ -0,0 +1,3 @@
class Suppa:
def foo(self):
print("bar")

View File

@@ -0,0 +1,6 @@
class Foo:
def bar(self):
print("foo")
def foo(self):
print("bar")

View File

@@ -0,0 +1,3 @@
class Suppa:
def foo(self):
print("bar")

View File

@@ -0,0 +1,7 @@
from a.b.suppa import Suppa
class Foo(Suppa):
def bar(self):
print("foo")

View File

@@ -0,0 +1,6 @@
class Foo:
def bar(self):
print("foo")
def foo(self):
print("bar")

View File

@@ -0,0 +1,7 @@
from a.suppa import Suppa
class Foo(Suppa):
def bar(self):
print("foo")

View File

@@ -0,0 +1,3 @@
class Suppa:
def foo(self):
print("bar")

View File

@@ -0,0 +1,6 @@
class Foo:
def bar(self):
print("foo")
def foo(self):
print("bar")

View File

@@ -0,0 +1,6 @@
class Foo:
def bar(self):
print "foo"
def foo(self):
print "bar"

View File

@@ -0,0 +1,3 @@
class Suppa:
def foo(self):
print "bar"

View File

@@ -0,0 +1,3 @@
class A:
def me<caret>thod(self):
pass

View File

@@ -0,0 +1,3 @@
def f():
def <caret>g():
pass

View File

@@ -0,0 +1,3 @@
def f():
def <caret>g():
pass

View File

@@ -0,0 +1,3 @@
class A:
def me<caret>thod(self):
pass