Skip to content

gh-109234: Enhanced sqlite3 connection context management documentation with contextlib.closing #109322

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 35 commits into from
Oct 3, 2023

Conversation

Lincoln-developer
Copy link
Contributor

@Lincoln-developer Lincoln-developer commented Sep 12, 2023

…textlib.closing

Enhance sqlite3 connection context management documentation with contextlib.closing #109234

This change enhances the existing sqlite3 docs on context management by adding a mention of the contextlib.closing to help guide developers when performing singular transactions.


📚 Documentation preview 📚: https://cpython-previews--109322.org.readthedocs.build/

@bedevere-app
Copy link

bedevere-app bot commented Sep 12, 2023

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@Lincoln-developer Lincoln-developer changed the title Enhanced sqlite3 connection context management documentation with con… Enhanced sqlite3 connection context management documentation with contextlib.closing Sep 12, 2023
@Lincoln-developer Lincoln-developer changed the title Enhanced sqlite3 connection context management documentation with contextlib.closing Enhanced sqlite3 connection context management documentation with contextlib.closing gh-109234 Sep 12, 2023
@Lincoln-developer
Copy link
Contributor Author

Hey am inquiring how can I run the doctests, could someone guide me on this , thanks

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I left some comments regarding how to improve the docs on this topic.

Also, please remove all non-relevant changes (style changes, whitespace changes, etc); this goes for all kinds of CPython PRs (code, docs, infra, etc.)

@nanjekyejoannah
Copy link
Contributor

As far as I see you have addressed comments from @erlend-aasland , thanks for the PR.

@nanjekyejoannah nanjekyejoannah merged commit 4227bfa into python:main Oct 3, 2023
@nanjekyejoannah
Copy link
Contributor

Congrats on your first CPython contribution @Lincoln-developer and thanks for working on this PR diligently.

@merwok
Copy link
Member

merwok commented Oct 3, 2023

Please clean up the commit message next time – github’s interface for some misguided reason concatenates all the individual commit messages and hides that, so manual care is needed.

(Also the common commit message style is followed, such as imperative Do x and y used rather than Does x and y which is ambiguous as it could describe a buggy behaviour before the change or new behaviour after the change)

@nanjekyejoannah
Copy link
Contributor

oops forgot this, good call.

@erlend-aasland erlend-aasland added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Oct 3, 2023
@miss-islington

This comment was marked as outdated.

@miss-islington

This comment was marked as outdated.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 3, 2023
…textlib.closing pythongh-109234 (pythonGH-109322)

* Enhanced sqlite3 connection context management documentation with contextlib.closing

* 📜🤖 Added by blurb_it.

* Fixed gitignore spelling error from nitignore to gitignore

* Renamed .gitignore to .nitignore

* Added generated doctests

* Deleted sqlite3 generated files

* Removed white-space changes

* Removed News entry from the doc

* Expanded a note that context manager can be used for connection management using contextlib.closing

* Removed repeated contextlib.closing code snippet

* Expanded the note around usage of context manageer for sqlite3 connection management

* Deleted extra white-spaces

* Deleted extra white-space

* re-arranged context manager wording

* Re-arranged word layout on how to use context manager

* Fix whitespace errors

* Remove unneeded change in .gitignore

* Added suggested changes

* Added suggested change redirecting to the contextlib.closing implementation

* Added closing keyword

* Removed line 2473

---------

(cherry picked from commit 4227bfa)

Co-authored-by: Lincoln <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 3, 2023
…textlib.closing pythongh-109234 (pythonGH-109322)

* Enhanced sqlite3 connection context management documentation with contextlib.closing

* 📜🤖 Added by blurb_it.

* Fixed gitignore spelling error from nitignore to gitignore

* Renamed .gitignore to .nitignore

* Added generated doctests

* Deleted sqlite3 generated files

* Removed white-space changes

* Removed News entry from the doc

* Expanded a note that context manager can be used for connection management using contextlib.closing

* Removed repeated contextlib.closing code snippet

* Expanded the note around usage of context manageer for sqlite3 connection management

* Deleted extra white-spaces

* Deleted extra white-space

* re-arranged context manager wording

* Re-arranged word layout on how to use context manager

* Fix whitespace errors

* Remove unneeded change in .gitignore

* Added suggested changes

* Added suggested change redirecting to the contextlib.closing implementation

* Added closing keyword

* Removed line 2473

---------

(cherry picked from commit 4227bfa)

Co-authored-by: Lincoln <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 3, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Oct 3, 2023
@bedevere-app
Copy link

bedevere-app bot commented Oct 3, 2023

GH-110294 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Oct 3, 2023
@erlend-aasland
Copy link
Contributor

I'll take care of the backports.

@bedevere-app

This comment was marked as duplicate.

@bedevere-app

This comment was marked as duplicate.

erlend-aasland added a commit that referenced this pull request Oct 3, 2023
…er docs (GH-109322) (#110294)

(cherry picked from commit 4227bfa)

Co-authored-by: Lincoln <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <[email protected]>
erlend-aasland added a commit that referenced this pull request Oct 3, 2023
…er docs (GH-109322) (#110294)

(cherry picked from commit 4227bfa)

Co-authored-by: Lincoln <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <[email protected]>
@erlend-aasland
Copy link
Contributor

Please clean up the commit message next time – github’s interface for some misguided reason concatenates all the individual commit messages and hides that, so manual care is needed.

(Also the common commit message style is followed, such as imperative Do x and y used rather than Does x and y which is ambiguous as it could describe a buggy behaviour before the change or new behaviour after the change)

I'm surprised that the CI let this PR through; the PR title was not formatted correctly. I thought we had CI checks for these things.

@nanjekyejoannah nanjekyejoannah changed the title Enhanced sqlite3 connection context management documentation with contextlib.closing gh-109234 gh-109234: Enhanced sqlite3 connection context management documentation with contextlib.closing Oct 3, 2023
@Lincoln-developer
Copy link
Contributor Author

Thanks all , for the review and guidance upon working on this issue. l greatly appreciate !

@Lincoln-developer Lincoln-developer deleted the fix-issue-109234 branch October 4, 2023 06:20
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…textlib.closing pythongh-109234 (python#109322)

* Enhanced sqlite3 connection context management documentation with contextlib.closing

* 📜🤖 Added by blurb_it.

* Fixed gitignore spelling error from nitignore to gitignore

* Renamed .gitignore to .nitignore

* Added generated doctests

* Deleted sqlite3 generated files

* Removed white-space changes

* Removed News entry from the doc

* Expanded a note that context manager can be used for connection management using contextlib.closing

* Removed repeated contextlib.closing code snippet

* Expanded the note around usage of context manageer for sqlite3 connection management

* Deleted extra white-spaces

* Deleted extra white-space

* re-arranged context manager wording

* Re-arranged word layout on how to use context manager

* Fix whitespace errors

* Remove unneeded change in .gitignore

* Added suggested changes

* Added suggested change redirecting to the contextlib.closing implementation

* Added closing keyword

* Removed line 2473

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants