Skip to content

Allow .. versionadded:: next in docs #121277

Description

@encukou

Feature or enhancement

Proposal:

In a PR to CPython, the versionadded, versionchanged, versionremoved, deprecated, deprecated-removed directives in documentation should currently be set to the upcoming release.

This is inconvenient:

  • the numbers need to be changed in backports
  • if a PR misses a feature release, the number needs to be updated

It would be good to treat this more like News entries, which live in a next/ directory before a release, when the release manager bundles them up and assigns a version.

Concrete proposal:

  • Teach versionadded & the others to expand the version argument next to <version> (unreleased) (e.g. 3.14.0b0 (unreleased)).
  • Add a tool that replaces the next with a given string (e.g. 3.14).
  • Modify the release manager tooling to run the tool on release.
  • Add a check to release manager tooling that built HTML documentation for a fresh release does not include the string (unreleased). The RM should be able to skip this test, in case of a false positive.
  • Update the Devguide.
  • Announce in Discourse

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/automating-versionadded-changed-markers-in-docs-to-expedite-prs/38423

Linked PRs

Related PRs

Discourse announcement

Activity

  1. encukou commented on Jul 2, 2024

    @encukou
    MemberAuthor

    It might be better for the tool to live outside the cpython repo, like blurb.

  2. gpshead commented on Jul 12, 2024

    @gpshead
    Member

    It might be better for the tool to live outside the cpython repo, like blurb.

    The tool for replacing version "next" in .rst files with the number makes sense to keep in repo to me (as your draft PR does for now) as it is small. Really not a lot more than could be done with some inscrutable sed commands.

  3. encukou commented on Jul 22, 2024

    @encukou
    MemberAuthor

    It's small, but there can still be bugs in it, and it'd be easier to deal with those if we don't need to backport them.

    @hugovk You said elsewhere that you'd prefer the version-bumping tool to live outside CPython repo. Since it's so small, I'd add it (and its test) to https://github.com/python/release-tools directly. Would that work?

    You're a RM, so you get to choose the bikeshed paint here :)

  4. hugovk commented on Jul 24, 2024

    @hugovk
    Member

    @hugovk You said elsewhere that you'd prefer the version-bumping tool to live outside CPython repo. Since it's so small, I'd add it (and its test) to python/release-tools directly. Would that work?

    Yep, this sounds good 👍 🖌️

  5. added 2 commits that reference this issue on Sep 24, 2024
  6. added 2 commits that reference this issue on Sep 26, 2024
  7. added 2 commits that reference this issue on Sep 27, 2024
  8. 3 remaining items

  9. encukou commented on Oct 28, 2024

    @encukou
    MemberAuthor

    It's now in 3.13 & 3.12. I plan to wait for releases from those branches before offering this to RMs of the security-only ones. (This is obviously not a security fix, but as a feature designed to make backporting easier, it might get an exception.)

  10. hugovk commented on Oct 28, 2024

    @hugovk
    Member

    It worked well for 3.14.0a1, you can see the next -> 3.14 changes in 8cdaca8 👍

  11. encukou commented on Oct 28, 2024

    @encukou
    MemberAuthor

    Yup!
    Pre-releases and dot-0's do have slightly different behaviour though.

  12. added a commit that references this issue on Dec 11, 2024
  13. added a commit that references this issue on Dec 11, 2024
  14. added 2 commits that reference this issue on Dec 12, 2024
  15. added a commit that references this issue on Dec 13, 2024
  16. added a commit that references this issue on Dec 20, 2024
  17. AA-Turner commented on Jan 11, 2025

    @AA-Turner
    Member

    @encukou anything left here?

    A

  18. encukou commented on Jan 13, 2025

    @encukou
    MemberAuthor

    Łukasz's decision on backporting to 3.9, and then updating the devguide.

  19. added a commit that references this issue on Jan 23, 2025
  20. encukou commented on Jan 27, 2025

    @encukou
    MemberAuthor

    Devguide PR open: python/devguide#1503

    With that, I'll close this issue. Thank you everyone for feedback & reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions