 +    deps = [
 +        ":example_pkg_with_data"
 +    ]
-+)
+ )
+
+ py_test(
+@@ -157,5 +184,6 @@ py_test(
+         ":minimal_with_py_library",
+         ":minimal_with_py_package",
+         ":python_requires_in_a_package"
++        ":use_genrule_with_dir_in_outs",
+     ],
+ )
+diff --git experimental/examples/wheel/wheel_test.py experimental/examples/wheel/wheel_test.py
+index b392457..b1ffdde 100644
+--- experimental/examples/wheel/wheel_test.py
++++ experimental/examples/wheel/wheel_test.py
+@@ -181,6 +181,21 @@ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
+ UNKNOWN
+ """)
+
++    def test_genrule_creates_directory_and_is_included_in_wheel(self):
++        filename = os.path.join(os.environ['TEST_SRCDIR'],
++                                'rules_python', 'experimental',
++                                'examples', 'wheel',
++                                'use_genrule_with_dir_in_outs-0.0.1-py3-none-any.whl')
 +
- py_test(
-     name = "wheel_test",
-     srcs = ["wheel_test.py"],
++        with zipfile.ZipFile(filename) as zf:
++            self.assertEquals(
++                zf.namelist(),
++                ['experimental/examples/wheel/main.py',
++                 'experimental/examples/wheel/someDir/foo.py',
++                 'use_genrule_with_dir_in_outs-0.0.1.dist-info/WHEEL',
++                 'use_genrule_with_dir_in_outs-0.0.1.dist-info/METADATA',
++                 'use_genrule_with_dir_in_outs-0.0.1.dist-info/RECORD'])
++
+
+ if __name__ == '__main__':
+     unittest.main()
 diff --git experimental/tools/wheelmaker.py experimental/tools/wheelmaker.py
-index 38fb122..4c7be30 100644
+index 799eed7..5d9ff89 100644
 --- experimental/tools/wheelmaker.py
 +++ experimental/tools/wheelmaker.py
-@@ -102,6 +102,11 @@ class WheelMaker(object):
+@@ -102,6 +102,13 @@ class WheelMaker(object):
 
              return normalized_arcname
 
-+        # If anywhere in the dependency tree a directory is set
-+        # it will be passed in as an input file and we need to
-+        # ignore.
 +        if os.path.isdir(real_filename):
++            directory_contents = os.listdir(real_filename)
++            for file_ in directory_contents:
++                self.add_file(f"{package_filename}/{file_}",
++                              f"{real_filename}/{file_}")
 +            return
++
          arcname = arcname_from(package_filename)
 
          self._zipfile.write(real_filename, arcname=arcname)

+genrule(
+    name="gen_dir",
+    outs=["someDir"],
+    cmd="mkdir -p $@",
+)
+
 # Package just a specific py_libraries, without their dependencies

 py_wheel(
     name = "minimal_with_py_package",
     # Package data. We're building "example_minimal_package-0.0.1-py3-none-any.whl"
@@ -144,6 +164,13 @@ py_wheel(
     deps = [
         ":example_pkg",
     ],
+    name = "use_genrule_with_dir_in_outs",
+    distribution = "use_genrule_with_dir_in_outs",
+    python_tag = "py3",
