areusch commented on a change in pull request #8735:
URL: https://github.com/apache/tvm/pull/8735#discussion_r687859287



##########
File path: docs/Makefile
##########
@@ -61,147 +62,176 @@ help:
        @echo "  coverage   to run coverage check of the documentation (if 
enabled)"
 
 clean:
-       rm -rf $(BUILDDIR)/*
+       rm -rf $(BUILDDIR)
+       rm -rf $(STAGINGDIR)
+       # Remove folders that have since been relocated into
+       # $(STAGINGDIR).  This allows `task_sphinx_precheck.sh` to
+       # run, even if a commit that predates $(STAGINGDIR) was
+       # previously run on that node.
        rm -rf gen_modules

Review comment:
       can you update these?

##########
File path: .gitignore
##########
@@ -63,7 +63,7 @@ instance/
 
 # Sphinx documentation
 docs/_build/
-docs/gen_modules

Review comment:
       why is this getting removed?

##########
File path: docs/Makefile
##########
@@ -61,147 +62,176 @@ help:
        @echo "  coverage   to run coverage check of the documentation (if 
enabled)"
 
 clean:
-       rm -rf $(BUILDDIR)/*
+       rm -rf $(BUILDDIR)
+       rm -rf $(STAGINGDIR)
+       # Remove folders that have since been relocated into
+       # $(STAGINGDIR).  This allows `task_sphinx_precheck.sh` to
+       # run, even if a commit that predates $(STAGINGDIR) was
+       # previously run on that node.
        rm -rf gen_modules
+       rm -rf user_tutorials
        rm -rf tutorials
        rm -rf vta/tutorials
 
-html:
-       $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+staging:
+       mkdir -p $(STAGINGDIR)
+
+       # Remove any symlinks that currently exist

Review comment:
       comment why

##########
File path: docs/conf.py
##########
@@ -30,18 +30,30 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 import gc
-import sys
+import importlib.util
 import inspect
-import os, subprocess
+import os
+from pathlib import Path
 import shlex
+import subprocess
+import sys
+
 import sphinx_gallery
 
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
-sys.path.insert(0, os.path.join(curr_path, "../python/"))
-sys.path.insert(0, os.path.join(curr_path, "../vta/python"))
+curr_path = Path(__file__).expanduser().absolute().parent
+if curr_path.name == "_staging":
+    # Can't use curr_path.parent, because sphinx_gallery requires a relative 
path.
+    tvm_path = Path(os.pardir, os.pardir)
+else:
+    tvm_path = Path(os.pardir)
+
+
+sys.path.insert(0, str(tvm_path.joinpath("python")))

Review comment:
       minor nit: could use tvm_path / "python" i think

##########
File path: docs/conf.py
##########
@@ -197,24 +209,24 @@ def git_describe_version(original_version):
 
 from sphinx_gallery.sorting import ExplicitOrder
 
-examples_dirs = ["../tutorials/", "../vta/tutorials/"]
+examples_dirs = [tvm_path.joinpath("tutorials"), tvm_path.joinpath("vta", 
"tutorials")]
 gallery_dirs = ["tutorials", "vta/tutorials"]
 
 subsection_order = ExplicitOrder(
     [
-        "../tutorials/get_started",
-        "../tutorials/frontend",
-        "../tutorials/language",
-        "../tutorials/optimize",
-        "../tutorials/autotvm",
-        "../tutorials/auto_scheduler",
-        "../tutorials/dev",
-        "../tutorials/topi",
-        "../tutorials/deployment",
-        "../tutorials/micro",
-        "../vta/tutorials/frontend",
-        "../vta/tutorials/optimize",
-        "../vta/tutorials/autotvm",
+        str(tvm_path.joinpath("tutorials", "get_started")),

Review comment:
       minor nit: 
   ```
   ExplicitOrder([str(p) for p in [
       tvm_path / "tutorials" / "get_started",
       ...
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to