Automated rollback of commit 0f9c6ea574918dda094cf5423fa3822112846c30.

*** Reason for rollback ***

Breaks Kokoro and I accidentally submitted the change without presubmit checks.

*** Original change description ***

Make __init__.py files creation optional

Introduce a new attribute to py_binary and py_test to control whether to
create `__init__.py` or not.

Fixes https://github.com/bazelbuild/rules_python/issues/55

Closes #4470.

PiperOrigin-RevId: 185676592
diff --git a/examples/py/BUILD b/examples/py/BUILD
index 314bc16..39ef8c0 100644
--- a/examples/py/BUILD
+++ b/examples/py/BUILD
@@ -8,7 +8,6 @@
 py_binary(
     name = "bin",
     srcs = ["bin.py"],
-    legacy_create_init = False,
     deps = [":lib"],
 )
 
diff --git a/examples/py/bin.py b/examples/py/bin.py
index cdc01c4..f4a6666 100644
--- a/examples/py/bin.py
+++ b/examples/py/bin.py
@@ -1,3 +1,3 @@
-import lib
+from examples.py import lib
 
 print("Fib(5)=%d" % lib.Fib(5))
diff --git a/examples/py_native/BUILD b/examples/py_native/BUILD
index aafa7b7..9d52fd6 100644
--- a/examples/py_native/BUILD
+++ b/examples/py_native/BUILD
@@ -10,7 +10,6 @@
 py_binary(
     name = "bin",
     srcs = ["bin.py"],
-    legacy_create_init = False,
     deps = [
         ":lib",
         "//examples/py_native/fibonacci",
@@ -25,7 +24,6 @@
 py_test(
     name = "test",
     srcs = ["test.py"],
-    legacy_create_init = False,
     deps = [
         ":lib",
         "//examples/py_native/fibonacci",
@@ -35,6 +33,5 @@
 py_test(
     name = "fail",
     srcs = ["fail.py"],
-    legacy_create_init = False,
     deps = [":lib"],
 )
diff --git a/examples/py_native/bin.py b/examples/py_native/bin.py
index b7e1223..45c68b2 100644
--- a/examples/py_native/bin.py
+++ b/examples/py_native/bin.py
@@ -1,7 +1,7 @@
 # pylint: disable=superfluous-parens
 """A tiny example binary for the native Python rules of Bazel."""
+from examples.py_native.lib import GetNumber
 from fib import Fib
-from lib import GetNumber
 
 print("The number is %d" % GetNumber())
 print("Fib(5) == %d" % Fib(5))
diff --git a/examples/py_native/fail.py b/examples/py_native/fail.py
index a505ac4..98e35f4 100644
--- a/examples/py_native/fail.py
+++ b/examples/py_native/fail.py
@@ -1,6 +1,6 @@
 """A tiny example binary for the native Python rules of Bazel."""
 import unittest
-from lib import GetNumber
+from examples.py_native.lib import GetNumber
 
 
 class TestGetNumber(unittest.TestCase):
diff --git a/examples/py_native/test.py b/examples/py_native/test.py
index b860940..f9543aa 100644
--- a/examples/py_native/test.py
+++ b/examples/py_native/test.py
@@ -1,8 +1,8 @@
 """A tiny example binary for the native Python rules of Bazel."""
 
 import unittest
+from examples.py_native.lib import GetNumber
 from fib import Fib
-from lib import GetNumber
 
 
 class TestGetNumber(unittest.TestCase):