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 — bpo-36675: Doc: Reveal doctest directives by JulienPalard · Pull Request #23620 · python/cpython

Conversation

@JulienPalard

@JulienPalard JulienPalard commented Dec 2, 2020 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Doctest directive were hidden in HTML and PDF output, this PR show them back.

https://bugs.python.org/issue36675

Sorry, something went wrong.

Uh oh!

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

bayersglassey-zesty reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@JulienPalard
Doc: Reveal doctest directives.
eb7fcb8
@JulienPalard JulienPalard added skip news needs backport to 3.8 labels Dec 2, 2020
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Dec 2, 2020
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting core review labels Dec 2, 2020
@JulienPalard
A newer Sphinx is required to have no-trim-doctest-flags.
ac88608
@JulienPalard JulienPalard removed needs backport to 3.8 labels Dec 2, 2020
@JulienPalard

JulienPalard commented Dec 2, 2020

Copy link
Copy Markdown
Member Author

Backport won't be possible, we have older sphinx on older branches.

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard

JulienPalard commented Dec 3, 2020

Copy link
Copy Markdown
Member Author

@andresdelfino I see you a lot on the doc those time, though you would be interested in proofreading this :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@andresdelfino

andresdelfino commented Dec 3, 2020

Copy link
Copy Markdown
Contributor

@JulienPalard Sure!

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard
JulienPalard merged commit c8a10d2 into python:master Dec 15, 2020
@bedevere-bot bedevere-bot removed the awaiting core review label Dec 15, 2020
@andresdelfino

andresdelfino commented Dec 15, 2020

Copy link
Copy Markdown
Contributor

@JulienPalard could you check the comment I made? I believe something is missing.

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard

JulienPalard commented Dec 16, 2020

Copy link
Copy Markdown
Member Author

@andresdelfino Gladly, but, which comment?

All reactions

Sorry, something went wrong.

Uh oh!

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

andresdelfino
andresdelfino reviewed Dec 16, 2020
View reviewed changes
Comment thread Doc/library/doctest.rst
Another bad idea is to print things that embed an object address, like

.. doctest::

@andresdelfino andresdelfino Dec 3, 2020

Copy link
Copy Markdown
Contributor

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.

Perhaps

Suggested change
:no-trim-doctest-flags:

is missing here?

Sorry, something went wrong.

Uh oh!

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

All reactions

@andresdelfino andresdelfino Dec 3, 2020

Copy link
Copy Markdown
Contributor

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.

The rendered docs doesn't show the doctest directive in this case.

Sorry, something went wrong.

Uh oh!

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

All reactions

@JulienPalard JulienPalard Dec 17, 2020

Copy link
Copy Markdown
Member Author

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.

I think it's better to keep it hidden in this case. The case is:

>>> id(1.0) # certain to fail some of the time  
7948648
>>> class C: pass
>>> C()   # the default repr() for instances embeds an address  
<C object at 0x00AC18F0>

the comment in the case is true: it's expected to fail. If we reveal the hidden doctest: +SKIP it's no longer expected to fail, the comment becomes erroneous.

The point of this example is to demo usefull cases for +ELLIPSIS, not +SKIP.

Sorry, something went wrong.

Uh oh!

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

All reactions

@andresdelfino andresdelfino Dec 17, 2020

Copy link
Copy Markdown
Contributor

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.

Oh, ok :)

Sorry, something went wrong.

Uh oh!

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

All reactions
@andresdelfino

andresdelfino commented Dec 16, 2020

Copy link
Copy Markdown
Contributor

@JulienPalard sorry, I thought it was submitted, but I was seeing a draft.

All reactions

Sorry, something went wrong.

Uh oh!

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

@asottile

asottile commented Jan 5, 2021

Copy link
Copy Markdown
Contributor

This breaks the minimum version of sphinx listed in Docs/conf.py:

cpython/Doc/conf.py

Line 48 in f7f0ed5

needs_sphinx = '1.8'

:no-trim-doctest-flags: was added in sphinx 3.2 whereas the minimum version in Docs/conf.py is 1.8: sphinx-doc/sphinx@784e763

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard

JulienPalard commented Jan 6, 2021

Copy link
Copy Markdown
Member Author

@asottile that's right, let's bump this, thanks for noticing!

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard JulienPalard mentioned this pull request Jan 6, 2021
bpo-42843: Doc: Bump Sphinx min-version (needed as we use :no-trim-doctest-flags:). #24142
Closed
@asottile

asottile commented Jan 6, 2021

Copy link
Copy Markdown
Contributor

@JulienPalard there's been additional efforts in this release to maintain compatibility with 1.x so there might be competing opinions here

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard

JulienPalard commented Jan 6, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Ok so let's discuss this futher in an issue. I'm opening it → https://bugs.python.org/issue42843

All reactions

Sorry, something went wrong.

Uh oh!

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

@asottile

asottile commented Jan 6, 2021

Copy link
Copy Markdown
Contributor

sounds good -- I only noticed this because it broke the packaging for deadsnakes (on 20.04, 18.04 and 16.04) so I reverted this patch there: deadsnakes/python3.10@f69292e

All reactions

Sorry, something went wrong.

Uh oh!

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

@JulienPalard

JulienPalard commented Jan 6, 2021

Copy link
Copy Markdown
Member Author

I only noticed this because it broke the packaging for deadsnakes

Sorry for this :(

All reactions

Sorry, something went wrong.

Uh oh!

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

@asottile

asottile commented Jan 6, 2021

Copy link
Copy Markdown
Contributor

I only noticed this because it broke the packaging for deadsnakes

Sorry for this :(

no big deal, I'm considering dropping the documentation build since it's ~95% of my maintenance and I'm not sure anybody actually uses it.

All reactions

Sorry, something went wrong.

Uh oh!

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

JulienPalard added a commit to JulienPalard/cpython that referenced this pull request Jan 21, 2021
@JulienPalard
Revert "bpo-36675: Doc: Reveal doctest directives (pythonGH-23620)"
882b942
This reverts commit c8a10d2.
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@JulienPalard @adorilson
bpo-36675: Doc: Reveal doctest directives (pythonGH-23620)
fb38c64
@JulienPalard
JulienPalard deleted the doctest branch October 9, 2021 07:31
This was referenced May 5, 2022
gh-80856: doc: reveal doctest directives #92318
Merged
Doctest directives and comments missing from code samples #80856
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@andresdelfino andresdelfino andresdelfino left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

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.

5 participants

@JulienPalard @andresdelfino @asottile @the-knights-who-say-ni @bedevere-bot
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.