Skip to content

Commit 00964c2

Browse files
MrBagojkbradley
authored andcommitted
Fix warnings in doc build. (#177)
We were using `_list_files_with_extension` to find the assembly jar in spark-deep-learning, and simply taking the last jar in the directory where we expect the assembly file to be. During build and release this directory can also have `sources*.jar` which can come after `assembly*.jar`. I switched to using glob so we could check not only the extension but also part of the file name. Since `_list_files_with_extension` seems to be strictly a subset of glob, went ahead and replaced all usages of it. There was another issue in our doc build as well, the indentation of `index.rst` was causing some of the doc files to be missed. These files were being left out of the doc build with this warning: ``` /mnt/sparkdl/python/docs/index.rst:15: WARNING: toctree contains reference to nonexisting document u' sparkdl.graph' /mnt/sparkdl/python/docs/index.rst:15: WARNING: toctree contains reference to nonexisting document u' sparkdl.image' /mnt/sparkdl/python/docs/index.rst:15: WARNING: toctree contains reference to nonexisting document u' sparkdl.transformers' /mnt/sparkdl/python/docs/index.rst:15: WARNING: toctree contains reference to nonexisting document u' sparkdl.udf' /mnt/sparkdl/python/docs/index.rst:15: WARNING: toctree contains reference to nonexisting document u' sparkdl.utils' checking consistency... /mnt/sparkdl/python/docs/sparkdl.graph.rst: WARNING: document isn't included in any toctree /mnt/sparkdl/python/docs/sparkdl.image.rst: WARNING: document isn't included in any toctree /mnt/sparkdl/python/docs/sparkdl.transformers.rst: WARNING: document isn't included in any toctree /mnt/sparkdl/python/docs/sparkdl.udf.rst: WARNING: document isn't included in any toctree /mnt/sparkdl/python/docs/sparkdl.utils.rst: WARNING: document isn't included in any toctree ```
1 parent c176516 commit 00964c2

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

dev/run.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from __future__ import print_function
77

8+
from glob import glob
89
import os
910
import subprocess
1011
import sys
@@ -32,10 +33,6 @@ def call_subprocess(cmd, add_env={}, verbose=True):
3233
return subprocess.call(cmd, env=env)
3334

3435

35-
def _list_files_with_extension(dir_name, ext):
36-
return [os.path.join(dir_name, f) for f in os.listdir(dir_name) if f.endswith(ext)]
37-
38-
3936
def _get_configured_env(_required_env):
4037
spark_home = _required_env["SPARK_HOME"]
4138
scala_version = _required_env["SCALA_VERSION"]
@@ -48,17 +45,17 @@ def _get_configured_env(_required_env):
4845
configured_env = {}
4946

5047
spark_lib_path = os.path.join(spark_home, "python/lib")
51-
configured_env["LIBS"] = ":".join(_list_files_with_extension(spark_lib_path, ".zip"))
48+
configured_env["LIBS"] = ":".join(glob(spark_lib_path + "/*.zip"))
5249

5350
scala_version_major_minor = ".".join(scala_version.split(".")[0:2])
5451
assembly_path = os.path.join(PROJECT_DIR, "target/scala-" + scala_version_major_minor)
55-
jar_path = ":".join(_list_files_with_extension(assembly_path, ".jar"))
52+
jar_path = ":".join(glob(assembly_path + "/*.jar"))
5653
configured_env["JAR_PATH"] = jar_path
5754

5855
python_paths = [
5956
os.getenv("PYTHONPATH", ""),
6057
os.path.join(PROJECT_DIR, "python"),
61-
_list_files_with_extension(assembly_path, ".jar")[-1],
58+
glob(assembly_path + "/*assembly*.jar")[-1],
6259
os.path.join(spark_home, "python"),
6360
configured_env["LIBS"]
6461
]

python/docs/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Contents:
1515
.. toctree::
1616
:maxdepth: 2
1717

18-
sparkdl.graph
19-
sparkdl.image
20-
sparkdl.transformers
21-
sparkdl.udf
22-
sparkdl.utils
18+
sparkdl.graph
19+
sparkdl.image
20+
sparkdl.transformers
21+
sparkdl.udf
22+
sparkdl.utils
2323

2424
Module contents
2525
---------------

0 commit comments

Comments
 (0)