Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
Add a new Sphinx soft-deprecated directive#148630
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
df3809c3f88cf5fe5f42e83ebd599b84663d20f5bfbee4f6cb43e9c20eee3e3768cab32d493f0a16ca8b7ebf41b70e7f8dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,7 +2,7 @@ | ||
| .. _allocating-objects: | ||
| Allocating Objects on the Heap | ||
| Allocating objects on the heap | ||
| ============================== | ||
| @@ -153,18 +153,20 @@ Allocating Objects on the Heap | ||
| To allocate and create extension modules. | ||
| Deprecated aliases | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| Soft-deprecated aliases | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| These are :term:`soft deprecated` aliases to existing functions and macros. | ||
| .. soft-deprecated:: 3.15 | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ZeroIntensity This section was first added to docs in #141146 and backported to 3.13. That PR said:
That links to code from PR #23586, which deprecated them in code comments in 3.10. So, should this say 3.15 or 3.10 or something else? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A 'lil ping @ZeroIntensity in case you missed these. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I missed this, thanks for the ping. I think 3.10 makes the most sense here. For clarification, some aliases documented by #141004 were marked with "soft deprecated" without a formal decision by the C API WG to mark them as such. I did this because:
This means that I bypassed the formal process for soft-deprecation on a few things (sorry!), so, at least for aliases, there's not always a clear version in which something was soft deprecated. For MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| These are aliases to existing functions and macros. | ||
| They exist solely for backwards compatibility. | ||
| .. list-table:: | ||
| :widths: auto | ||
| :header-rows: 1 | ||
| * * Deprecated alias | ||
| * * Soft-deprecated alias | ||
| * Function | ||
| * * .. c:macro:: PyObject_NEW(type, typeobj) | ||
| * :c:macro:`PyObject_New` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,7 +2,7 @@ | ||
| .. _fileobjects: | ||
| File Objects | ||
| File objects | ||
| ------------ | ||
| .. index:: pair: object; file | ||
| @@ -136,11 +136,12 @@ the :mod:`io` APIs instead. | ||
| failure; the appropriate exception will be set. | ||
| Deprecated API | ||
| ^^^^^^^^^^^^^^ | ||
| Soft-deprecated API | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| .. soft-deprecated:: 3.15 | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, this section was added in #141634 and backported to 3.13. I don't think this was deprecated in code comments. What version should we have? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ZeroIntensity And what about this one? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| These are :term:`soft deprecated` APIs that were included in Python's C API | ||
| These are APIs that were included in Python's C API | ||
| by mistake. They are documented solely for completeness; use other | ||
| ``PyFile*`` APIs instead. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
This change was intentional as it makes it explicit these aren't going away, and the header is new in 3.15.
Shall I:
deprecated-alisesjust above itDoc/tools/removed-ids.txtThere 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.
Seeing as it's quite new I think it is unlikely we're breaking anyone’s reference. So, I suggest we create a "remove from here in 3.16" section in
removed-ids.txtfor such changes.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.
Feedback for the tool output:
"above" should read "below". Can improve spacing to make both warnings more obvious:
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.
"above" is technically correct IIRC (from when I tried to add color), it is just GitHub mangling stdout/err and the line ends up above. We should have an issue for further improvements.
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.
Hmm, indeed, we can have different output:
https://github.com/python/cpython/actions/runs/24515704242/job/71659379442?pr=148630
https://github.com/python/cpython/actions/runs/24517209594/job/71664949402?pr=148630
After ignoring file.html:
https://github.com/python/cpython/actions/runs/24521766250/job/71681524452?pr=148630