From 852d259b96bfc95ccd4e9a34b77b37f00f5ae161 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 22 Jan 2024 16:25:30 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Skip=20showing=20changelog=20dra?= =?UTF-8?q?ft=20in=20release=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.rst | 7 ++++++- docs/conf.py | 8 ++++++++ tox.ini | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) 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