Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Jun 14, 2022
1 parent 1df00c7 commit a4310b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
24 changes: 8 additions & 16 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import shutil
import sys
import warnings
from importlib.util import module_from_spec, spec_from_file_location

import pt_lightning_sphinx_theme

import pytorch_lightninga

# -----------------------
# VARIABLES WHEN WORKING ON DOCS... MAKE THIS TRUE TO BUILD FASTER
# -----------------------
Expand All @@ -32,12 +33,10 @@
PATH_HERE = os.path.abspath(os.path.dirname(__file__))
PATH_ROOT = os.path.join(PATH_HERE, "..", "..")
PATH_RAW_NB = os.path.join(PATH_ROOT, "_notebooks")
_SHOULD_COPY_NOTEBOOKS = True
sys.path.insert(0, os.path.abspath(PATH_ROOT))
sys.path.append(os.path.join(PATH_RAW_NB, ".actions"))

_SHOULD_COPY_NOTEBOOKS = True


try:
from assistant import AssistantCLI
except ImportError:
Expand All @@ -47,12 +46,6 @@
FOLDER_GENERATED = "generated"
SPHINX_MOCK_REQUIREMENTS = int(os.environ.get("SPHINX_MOCK_REQUIREMENTS", True))

spec = spec_from_file_location(
"pytorch_lightning/__about__.py", os.path.join(PATH_ROOT, "pytorch_lightning", "__about__.py")
)
about = module_from_spec(spec)
spec.loader.exec_module(about)

# -- Project documents -------------------------------------------------------
if _SHOULD_COPY_NOTEBOOKS:
AssistantCLI.copy_notebooks(
Expand Down Expand Up @@ -85,13 +78,13 @@ def _transform_changelog(path_in: str, path_out: str) -> None:
# -- Project information -----------------------------------------------------

project = "PyTorch Lightning"
copyright = about.__copyright__
author = about.__author__
copyright = pytorch_lightning.__copyright__
author = pytorch_lightning.__author__

# The short X.Y version
version = about.__version__
version = pytorch_lightning.__version__
# The full version, including alpha/beta/rc tags
release = about.__version__
release = pytorch_lightning.__version__

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -192,7 +185,7 @@ def _transform_changelog(path_in: str, path_out: str) -> None:

html_theme_options = {
"pytorch_project": "https://pytorchlightning.ai",
"canonical_url": about.__docs_url__,
"canonical_url": pytorch_lightning.__docs_url__,
"collapse_navigation": False,
"display_version": True,
"logo_only": False,
Expand Down Expand Up @@ -344,7 +337,6 @@ def package_list_from_file(file):
}
MOCK_PACKAGES = []
if SPHINX_MOCK_REQUIREMENTS:
MOCK_PACKAGES += ["fairscale"]
_path_require = lambda fname: os.path.join(PATH_ROOT, "requirements", fname)
# mock also base packages when we are on RTD since we don't install them there
MOCK_PACKAGES += package_list_from_file(_path_require("base.txt"))
Expand Down
2 changes: 1 addition & 1 deletion src/pytorch_lightning/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
- https://pytorch-lightning.readthedocs.io/en/stable
"""

__all__ = ["__author__", "__author_email__", "__copyright__", "__docs__", "__homepage__", "__license__", "__version__"]
__all__ = ["__author__", "__author_email__", "__copyright__", "__docs__", "__docs_url__", "__homepage__", "__license__", "__version__"]

0 comments on commit a4310b0

Please sign in to comment.