Skip to content

Commit

Permalink
release: Bump version 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Revathyvenugopal162 committed Sep 16, 2024
1 parent 638b34d commit 0ad5dac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/494.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: ``autoapi`` relative directory path wrt ``tox`` env
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
[project]
# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
name = "ansys-sphinx-theme"
version = "1.0.8"
version = "1.0.9"
description = "A theme devised by ANSYS, Inc. for Sphinx documentation."
readme = "README.rst"
requires-python = ">=3.9,<4"
Expand Down
14 changes: 10 additions & 4 deletions src/ansys_sphinx_theme/extension/autoapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""Module containing an extension for creating Sphinx AutoAPI templates for the Ansys Sphinx Theme.""" # noqa: E501

import os
from pathlib import Path
from typing import Any, Dict

from sphinx.application import Sphinx
Expand Down Expand Up @@ -79,10 +80,15 @@ def prepare_jinja_env(jinja_env) -> None:
app.config["autoapi_member_order"] = autoapi.get("member_order", "bysource")

# HACK: The ``autoapi_dirs`` should be given as a relative path to the conf.py.
relative_autoapi_dir = os.path.relpath(
autoapi.get("directory", "src/ansys"), start=str(app.confdir / "conf.py")
)
app.config["autoapi_dirs"] = [relative_autoapi_dir]
autoapi_dir = autoapi.get("directory", "src/ansys")
# assume the docs are in doc/source directory
root_dir = Path(app.srcdir).resolve().parent.parent
path_to_autoapi_dir = (root_dir / autoapi_dir).resolve()
if path_to_autoapi_dir.exists():
relative_autoapi_dir = os.path.relpath(path_to_autoapi_dir, start=app.srcdir)
else:
relative_autoapi_dir = autoapi_dir
app.config["autoapi_dirs"] = [str(relative_autoapi_dir)]


def setup(app: Sphinx) -> Dict[str, Any]:
Expand Down

0 comments on commit 0ad5dac

Please sign in to comment.