diff --git a/docs/changelog.rst b/docs/changelog.rst index 40c39e1b3..8aebfc7a5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,7 +8,12 @@ versions with advance notice in the **Deprecations** section of releases. .. _Semantic Versioning: https://semver.org/ -.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT] +.. only:: not is_release + + .. towncrier-draft-entries:: |release| [UNRELEASED DRAFT] + + Released versions + ^^^^^^^^^^^^^^^^^ .. towncrier release notes start diff --git a/docs/conf.py b/docs/conf.py index 553f3deed..a2a3e4a00 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,7 @@ # Ref: https://www.sphinx-doc.org/en/master/usage/configuration.html """Configuration for the Sphinx documentation generator.""" +import os from functools import partial from pathlib import Path @@ -12,6 +13,13 @@ # -- Path setup -------------------------------------------------------------- PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve() +IS_RELEASE_ON_RTD = ( + os.getenv("READTHEDOCS", "False") == "True" + and os.environ["READTHEDOCS_VERSION_TYPE"] == "tag" +) +if IS_RELEASE_ON_RTD: + tags.add("is_release") + get_scm_version = partial(get_version, root=PROJECT_ROOT_DIR) # If extensions (or modules to document with autodoc) are in another directory, diff --git a/tox.ini b/tox.ini index 7dd4cc45f..bc56a7d94 100644 --- a/tox.ini +++ b/tox.ini @@ -352,6 +352,7 @@ commands = changedir = {toxinidir}/docs isolated_build = true passenv = + READTHEDOCS* SPHINX_BUILDER SPHINX_BUILD_OUTPUT_DIRECTORY SSH_AUTH_SOCK