Skip to content

Commit

Permalink
[PR #8069/69bbe874 backport][3.9] 📝 Only show changelog draft for non…
Browse files Browse the repository at this point in the history
…-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 <Name> <Surname>.
  * 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]>
  • Loading branch information
patchback[bot] and webknjaz authored Jan 28, 2024
1 parent 419d715 commit 3ec4fa1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES/8067.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The Sphinx setup was updated to avoid showing the empty
changelog draft section in the tagged release documentation
builds on Read The Docs -- by :user:`webknjaz`.
13 changes: 8 additions & 5 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
Changelog
=========

To be included in v\ |release| (if present)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. only:: not is_release

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

Released versions
^^^^^^^^^^^^^^^^^
.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT]

Released versions
^^^^^^^^^^^^^^^^^

.. include:: ../CHANGES.rst
:start-after: .. towncrier release notes start

.. include:: ../HISTORY.rst
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
from pathlib import Path

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")

_docs_path = os.path.dirname(__file__)
_version_path = os.path.abspath(
Expand Down

0 comments on commit 3ec4fa1

Please sign in to comment.