8000 gh-96414: Inline code examples in sqlite3 docs by erlend-aasland · Pull Request #96442 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-96414: Inline code examples in sqlite3 docs #96442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Aug 31, 2022

Conversation

erlend-aasland
Copy link
Contributor
@erlend-aasland erlend-aasland commented Aug 30, 2022

This PR inlines all sqlite3 doc examples into Doc/library/sqlite3.rst.
Except from adjusting the SQL style, the examples are mostly kept as they are;
some of them work well, others can be improved in later PRs.

@erlend-aasland
Copy link
Contributor Author

@CAM-Gerlach, do you think this is worth it? IMO, the benefits of inlining the examples (being able to doctest them, etc.) outweigh the churn. I don't expect you to review each line here; I've just moved a lot of lines :)

Copy link
Member
@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

IMO, Diataxis stresses that examples given must work and work reliably, especially for tutorials. So, given this just requires moving them around, actually testing them would seem to be worth it.

However, just to make sure, is the doctest CI check actually correctly failing if a doctest fails? Perhaps I'm mistaken, but at least per my recollection of a discussion on the Docs Community Discord, doctests failing doesn't actually fail the build, it just produces messages/output—but perhaps I'm entirely mistaken on that, and its just referring to warnings or something.

I did have some trivial comments regarding consistent SQL code style, given you mentioned that conforming that was in scope for this PR.

@erlend-aasland
Copy link
Contributor Author

However, just to make sure, is the doctest CI check actually correctly failing if a doctest fails?

Yes. I learned that when I applied doctests to the tutorial. Several of the examples had inconsistencies that made the code and thus the doctest fail.

@erlend-aasland
Copy link
Contributor Author

I did have some trivial comments regarding consistent SQL code style, given you mentioned that conforming that was in scope for this PR.

Thanks! :)

@erlend-aasland erlend-aasland merged commit f7e7bf1 into python:main Aug 31, 2022
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@erlend-aasland erlend-aasland deleted the sqlite-inline-examples branch August 31, 2022 05:55
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 31, 2022
(cherry picked from commit f7e7bf1)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@miss-islington
Copy link
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker f7e7bf161aaec5a5cffdcec7c97e1f09e445421b 3.10

@bedevere-bot
Copy link

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

miss-islington added a commit that referenced this pull request Aug 31, 2022
(cherry picked from commit f7e7bf1)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Aug 31, 2022
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request Aug 31, 2022
…-96442).

(cherry picked from commit f7e7bf1)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-bot
Copy link

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

erlend-aasland added a commit that referenced this pull request Aug 31, 2022
…6453)

* [3.10] gh-96414: Inline code examples in sqlite3 docs (GH-96442).
(cherry picked from commit f7e7bf1)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0