-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
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
Changes from all commits
df3809c
3f88cf5
fe5f42e
83ebd59
9b84663
d20f5bf
bee4f6c
b43e9c2
0eee3e3
768cab3
2d493f0
a16ca8b
7ebf41b
70e7f8d
File filter
Filter by extension
Conversations
Jump to
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 | ||
|
Member
Author
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? |
||
|
|
||
| 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 | ||
|
Member
Author
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? |
||
| 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. | ||
|
|
||
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