GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add a guide to deprecating features by Lincoln-developer · Pull Request #1469 · python/devguide Conversation
|
| * **Raise a Warning**: Use :func:`warnings.warn` with :exc:`DeprecationWarning` for typical cases. | ||
| If the feature is in its early deprecation phase: | ||
|
|
||
| * Use :exc:`PendingDeprecationWarning` initially, which transitions to :exc:`DeprecationWarning` after a suitable period. | ||
|
|
||
| Example: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| import warnings | ||
| warnings.warn( | ||
| "Feature X is deprecated and will be removed in Python 3.Y", | ||
| DeprecationWarning, | ||
| stacklevel=2 | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We should probably use warnings._deprecated() instead here
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks let me work on this change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ------------------------------------ | ||
| Before proposing deprecation: | ||
|
|
||
| * **Assess Usage**: Use tools like GitHub search, ``grep``, or ``PyPI statistics`` to determine the extent and context of usage. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could add links here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
okay sure, let me add them
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Once approved: | ||
|
|
||
| * **Raise a Warning**: Use ``warnings._deprecated`` with :exc:`DeprecationWarning` for typical cases. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why is this preferred over the documented and more common warnings.warn (over 3x in the stdlib)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Workflow for Deprecating Features in CPython | ||
| ============================================== |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Workflow for Deprecating Features in CPython | |
| ============================================== | |
| Workflow for Deprecating Features in CPython | |
| ============================================ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Workflow for Deprecating Features in CPython | ||
| ============================================== | ||
|
|
||
| Deprecation in CPython is a multi-step process that involves notifying users about deprecated functionality, planning its eventual removal, and providing adequate guidance for migration. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please wrap lines to 79 characters.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Before proposing deprecation: | ||
|
|
||
| * **Assess Usage**: Use tools like GitHub search, `grep`_, or `PyPI statistics`_ to determine the extent and context of usage. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a link to the GitHub search and list Victor's script: https://hugovk.dev/blog/2022/how-to-search-5000-python-projects/ ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Open an issue | ||
| ------------- | ||
|
|
||
| Start by creating a GitHub issue to propose the deprecation: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think we should recommend a thread on Discourse first?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ------------------ | ||
|
|
||
| * **Monitor Usage**: After the release, observe community feedback. Deprecations may remain longer than the minimum period if low maintenance overhead is expected or usage is widespread. | ||
| * **Timeline Review**: Use GitHub milestones or specific deprecation tracking issues to manage timelines. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
GitHub milestones
These are not used in CPython?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * Update documentation, removing references to the deprecated feature. | ||
| * Include the removal in the "What's New" for the release. | ||
|
|
||
| ``PendingDeprecationWarning`` workflow |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This stage seems odd, how often is this done?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ------------------------ | ||
|
|
||
| * Use the ``.. deprecated-removed::`` roles for documentation. | ||
| * Add ``See Also`` links to :pep:`387` and DevGuide for policy and process details. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, do you suggest a .. see-also:: under every deprecated feature?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * No ``pending-removal-in`` entry is needed during this stage. | ||
|
|
||
| References and templates | ||
| ------------------------ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We can also link to PEP 4
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| :maxdepth: 5 | ||
|
|
||
| communication-channels | ||
| cpython-deprecation-workflow |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This should definitely be below development cycle
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I see that at least three people have put in effort here, but it's stalled. I can carry it forward, if that seems appropriate. @StanFromIreland , as the most recent reviewer, what would you think of me picking this up and continuing the work in a new PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@sirosen yes, it would be great for someone to pick this up, this has been stale for a while. I would suggest that whoever does pick it up do at least one deprecation in CPython beforehand. I think part of the issue here was that current practices aren't written down, which made it easy to end up inventing new ones. If you have any questions while working on this, feel free to ask/ping me. Other things worth covering here would be soft deprecations. I also wouldn't focus too much on the "When to deprecate?" section, that's a difficult topic and all cases can't be covered by the docs, some general guidelines would suffice. In the future we could also expand the section to cover removing the deprecated items, as this gets difficult e.g. when things are in the stable ABI. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
And might be worth starting this guide from scratch, rather than continuing from this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Unfortunately, that would rule me out as a candidate to carry this work forward. Maybe that's okay, but I am also happy to write down current practice with a bit of guidance. I'll circle back on the idea -- there might be other places where I can be more helpful. Given that review time was sunk into this, rather than it being closed, I was under the impression that it was close (or close enough) to be worth carrying on and preserving commits/credit. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Based on the bot's comment above, it's alright. But this has been stale for a long time, so I think it's time to close anyway. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh, I hadn't noticed the comment, only the GHA check status. Odd that they got out of alignment, but okay anyway. 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It sometimes get stuck like that, if I re-opened it would re-run and go green. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Document the workflow for deprecating something in CPython.
There was an error while loading. Please reload this page.