GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-80856: doc: reveal doctest directives by sorcio · Pull Request #92318 · python/cpython

Conversation

@sorcio

@sorcio sorcio commented May 5, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue: gh-80856

This is literally just the change from #23620 cherry-picked to apply on top of main again.

Since docs now build on Sphinx 4.5.0, :no-trim-doctest-flags: is now supported and this change can be applied.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JulienPalard @sorcio
Doc: Reveal doctest directives.
4935784
@ghost

ghost commented May 5, 2022 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels May 5, 2022
@sorcio sorcio mentioned this pull request May 5, 2022
Doctest directives and comments missing from code samples #80856
Closed
ezio-melotti
ezio-melotti approved these changes May 5, 2022
View reviewed changes

@ezio-melotti ezio-melotti left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of whitespace inconsistencies, but otherwise LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/doctest.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/doctest.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels May 5, 2022
@ezio-melotti
ezio-melotti requested a review from JulienPalard May 5, 2022 04:31
@AlexWaygood AlexWaygood added the skip news label May 5, 2022
@ezio-melotti ezio-melotti self-assigned this May 6, 2022
@ezio-melotti
Fix whitespace.
8e10cd7
@JulienPalard JulienPalard closed this May 7, 2022
@ezio-melotti ezio-melotti reopened this May 7, 2022
@JulienPalard JulienPalard reopened this May 7, 2022
@JelleZijlstra JelleZijlstra added needs backport to 3.9 needs backport to 3.11 only security fixes labels May 8, 2022
@ezio-melotti ezio-melotti removed the needs backport to 3.9 label May 8, 2022
@ezio-melotti
ezio-melotti merged commit 7b024e3 into python:main May 8, 2022
@miss-islington

miss-islington commented May 8, 2022

Copy link
Copy Markdown
Contributor

Thanks @sorcio for the PR, and @ezio-melotti for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label May 8, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2022
@sorcio @miss-islington
pythongh-80856: doc: reveal doctest directives (pythonGH-92318)
88c2339
* Doc: Reveal doctest directives.

* Fix whitespace.

Co-authored-by: Julien Palard <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
(cherry picked from commit 7b024e3)

Co-authored-by: Davide Rizzo <[email protected]>
@bedevere-bot

bedevere-bot commented May 8, 2022

Copy link
Copy Markdown

GH-92493 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed needs backport to 3.11 only security fixes needs backport to 3.10 labels May 8, 2022
@bedevere-bot

bedevere-bot commented May 8, 2022

Copy link
Copy Markdown

GH-92494 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2022
@sorcio @miss-islington
pythongh-80856: doc: reveal doctest directives (pythonGH-92318)
f0e46b8
* Doc: Reveal doctest directives.

* Fix whitespace.

Co-authored-by: Julien Palard <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
(cherry picked from commit 7b024e3)

Co-authored-by: Davide Rizzo <[email protected]>
miss-islington added a commit that referenced this pull request May 8, 2022
@miss-islington @sorcio
gh-80856: doc: reveal doctest directives (GH-92318)
1dbf699
* Doc: Reveal doctest directives.

* Fix whitespace.

Co-authored-by: Julien Palard <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
(cherry picked from commit 7b024e3)

Co-authored-by: Davide Rizzo <[email protected]>
miss-islington added a commit that referenced this pull request May 8, 2022
@miss-islington @sorcio
gh-80856: doc: reveal doctest directives (GH-92318)
d6b83a3
* Doc: Reveal doctest directives.

* Fix whitespace.

Co-authored-by: Julien Palard <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
(cherry picked from commit 7b024e3)

Co-authored-by: Davide Rizzo <[email protected]>
@JulienPalard

JulienPalard commented May 8, 2022

Copy link
Copy Markdown
Member

Beware @sorcio, this "breaks" the minimum version of sphinx listed in Docs/conf.py:

cpython/Doc/conf.py

Line 48 in 859250c

needs_sphinx = '1.8'

The :no-trim-doctest-flags: was added in sphinx 3.2, so you need to bump to needs-sphinx = '3.2'.

Bumping needs-sphinx to 3.2 were not OK one year ago, but it may be OK now, I really don't know. Let's ask to @asottile @doko42.

The only thing I see is that one year ago Debian stable were shipping sphinx-doc==1.8 and now it ships sphinx-doc==3.4, this was the lone blocker as seen by @vstinner in #87009 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sorcio

sorcio commented May 8, 2022

Copy link
Copy Markdown
Contributor Author

Hey @JulienPalard, thanks for the heads up! I'll wait for their responses and patch things up as needed. I hadn't noticed that you previously suggested compatibility with Sphinx 2 would be maintained for "a few more releases", otherwise I wouldn't have pushed this forward.

If the limitation to stay with Sphinx < 3 is confirmed, would it apply to 3.10 only or to main as well? This has been a bug in the published doc for a while. In the worst case, I'd consider adding a backport of the doctest directive.

I think the questions are:

  1. Can 3.10 use Sphinx 3.2+ features? (If yes, needs_sphinx has to be bumped)
  2. Can main? (If yes, needs_sphinx has to be bumped)
  3. If the answer to both is no, would it be acceptable to add a directive (maybe in pyspecific.py) to cover this case for older Sphinx?
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile

asottile commented May 9, 2022

Copy link
Copy Markdown
Contributor

I can't speak for debian but I've disabled the docs builds entirely for the pythons I distribute for deadsnakes (it ended up being 90%+ of the maintenance work so I stopped trying) so bumping the version there is no longer a concern for me! 👍

ambv and hugovk reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced May 9, 2022
Sphinx conf.py needs_version entry is outdated #86986
Closed
Dark theme python/python-docs-theme#44
Merged
@sorcio sorcio mentioned this pull request May 29, 2022
gh-86986: bump min sphinx version to 3.2 #93337
Merged
@hugovk hugovk mentioned this pull request Jun 12, 2022
gh-86986: Drop compatibility support for Sphinx 2 #93737
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ezio-melotti ezio-melotti ezio-melotti approved these changes
@JulienPalard JulienPalard Awaiting requested review from JulienPalard

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ezio-melotti ezio-melotti

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@sorcio @miss-islington @bedevere-bot @JulienPalard @asottile @ezio-melotti @JelleZijlstra @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.