Skip to content

Commit 3ec4fa1

Browse files
[PR #8069/69bbe874 backport][3.9] đź“ť Only show changelog draft for non-releases (#8070)
**This is a backport of PR #8069 as merged into master (69bbe87).** ## What do these changes do? $sbj. ## Are there changes in behavior for the user? RTD for tagged docs builds won't show the changelog draft (which should be empty in this context). ## Related issue number N/A ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes exist - [x] Documentation reflects the changes - [x] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` * The format is &lt;Name&gt; &lt;Surname&gt;. * Please keep alphabetical order, the file is sorted by names. - [x] Add a new news fragment into the `CHANGES/` folder * name it `<issue_or_pr_num>.<type>.rst` (e.g. `588.bugfix.rst`) * if you don't have an issue number, change it to the pull request number after creating the PR * `.bugfix`: A bug fix for something the maintainers deemed an improper undesired behavior that got corrected to match pre-agreed expectations. * `.feature`: A new behavior, public APIs. That sort of stuff. * `.deprecation`: A declaration of future API removals and breaking changes in behavior. * `.breaking`: When something public is removed in a breaking way. Could be deprecated in an earlier release. * `.doc`: Notable updates to the documentation structure or build process. * `.packaging`: Notes for downstreams about unobvious side effects and tooling. Changes in the test invocation considerations and runtime assumptions. * `.contrib`: Stuff that affects the contributor experience. e.g. Running tests, building the docs, setting up the development environment. * `.misc`: Changes that are hard to assign to any of the above categories. * Make sure to use full sentences with correct case and punctuation, for example: ```rst Fixed issue with non-ascii contents in doctest text files -- by :user:`contributor-gh-handle`. ``` Use the past tense or the present tense a non-imperative mood, referring to what's changed compared to the last released version of this project. Co-authored-by: Sviatoslav Sydorenko <[email protected]>
1 parent 419d715 commit 3ec4fa1

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

‎CHANGES/8067.doc.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The Sphinx setup was updated to avoid showing the empty
2+
changelog draft section in the tagged release documentation
3+
builds on Read The Docs -- by :user:`webknjaz`.

‎docs/changes.rst

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
Changelog
55
=========
66

7-
To be included in v\ |release| (if present)
8-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
.. only:: not is_release
98

10-
.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT]
9+
To be included in v\ |release| (if present)
10+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1111

12-
Released versions
13-
^^^^^^^^^^^^^^^^^
12+
.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT]
13+
14+
Released versions
15+
^^^^^^^^^^^^^^^^^
1416

1517
.. include:: ../CHANGES.rst
18+
:start-after: .. towncrier release notes start
1619

1720
.. include:: ../HISTORY.rst

‎docs/conf.py

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
from pathlib import Path
1919

2020
PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve()
21+
IS_RELEASE_ON_RTD = (
22+
os.getenv("READTHEDOCS", "False") == "True"
23+
and os.environ["READTHEDOCS_VERSION_TYPE"] == "tag"
24+
)
25+
if IS_RELEASE_ON_RTD:
26+
tags.add("is_release")
2127

2228
_docs_path = os.path.dirname(__file__)
2329
_version_path = os.path.abspath(

0 commit comments

Comments
 (0)