@@ -293,42 +293,49 @@ All API changes in Matplotlib have to be performed following the below
293
293
deprecation process. This ensures that users are notified before the change
294
294
will take effect and thus prevents unexpected breaking of code.
295
295
296
- - Definition of Deprecation
297
- - Deprecations are Announcements of future changes, stating that the status
298
- quo will be outdated in the future and replaced by a new standard
299
- - Users are advised to change their code in order to guarantee compatibility
300
- with future Matplotlib releases.
301
- - The Deprecation date is marked by the ``since `` argument, specifying from
302
- which release forward the argument is or was deprecated. The Deprecation
303
- date is not to be confused with the ``removal `` argument, specifying from
304
- which release forward the argument will be removed.
305
-
306
- - Deprecation Process
307
- - Rules
308
- - Deprecations are targeted at the next point.release (e.g. 3.x.0)
309
- - Deprecated API may be removed two point-releases after their initial
310
- Deprecation
311
- - The old API must remain fully functional during the Deprecation period
312
- - If valid alternatives to the deprecated API exist, they should be available
313
- during the Deprecation period
314
- - If in doubt, decisions about API changes are finally made by the
315
- API consistency lead developer
316
- - Process Schema
317
- 1. Deprecation Announcement via a new file in a new file in
318
- :file: `doc/api/next_api_changes/deprecations/ ` with naming convention
319
- ``99999-ABC.rst `` where ``99999 `` is the pull request number and ``ABC ``
320
- are the contributor's initials
321
- 2. Deprecations are then targeted at the next point-release (e.g. 3.x.0)
322
- 3. The continuing usage of a deprecated API should result in a
323
- Runtime Warming (`.MatplotlibDeprecationWarning `). There are a number
324
- of helper tools for this:
325
- - Use ``_api.warn_deprecated() `` for general deprecation warnings
326
- - Use the decorator ``@_api.deprecated `` to deprecate classes, functions,
327
- methods, or properties
328
- - To warn on changes of the function signature, use the decorators
329
- ``@_api.delete_parameter ``, ``@_api.rename_parameter ``, and
330
- ``@_api.make_keyword_only ``
331
- 4. Deprecated API gets removed two point-releases after initial Deprecation
296
+ Deprecation process
297
+ ~~~~~~~~~~~~~~~~~~~
298
+
299
+ Rules:
300
+
301
+ - Deprecations are targeted at the next point.release (e.g. 3.x)
302
+ - Deprecated API is generally removed two two point-releases after introduction
303
+ of the deprecation. Longer deprecations can be imposed by core developers on
304
+ a case-by-case basis to give more time for the transition
305
+ - The old API must remain fully functional during the deprecation period
306
+ - If alternatives to the deprecated API exist, they should be available
307
+ during the deprecation period
308
+ - If in doubt, decisions about API changes are finally made by the
309
+ API consistency lead developer
310
+
311
+ Introducing a deprecation:
312
+
313
+ 1. Announce the deprecation in a new file
314
+ :file: `doc/api/next_api_changes/deprecations/99999-ABC.rst ` where ``99999 ``
315
+ is the pull request number and ``ABC `` are the contributor's initials.
316
+ 2. If possible, issue a `.MatplotlibDeprecationWarning ` when the deprecated
317
+ API is used. There are a number of helper tools for this:
318
+
319
+ - Use ``_api.warn_deprecated() `` for general deprecation warnings
320
+ - Use the decorator ``@_api.deprecated `` to deprecate classes, functions,
321
+ methods, or properties
322
+ - To warn on changes of the function signature, use the decorators
323
+ ``@_api.delete_parameter ``, ``@_api.rename_parameter ``, and
324
+ ``@_api.make_keyword_only ``
325
+
326
+ All these helpers take a first parameter *since *, which should be set to
327
+ the next point release, e.g. "3.x".
328
+
329
+ Expiring a deprecation:
330
+
331
+ 1. Announce the API changes in a new file
332
+ :file: `doc/api/next_api_changes/[kind]/99999-ABC.rst ` where ``99999 ``
333
+ is the pull request number and ``ABC `` are the contributor's initials, and
334
+ ``[kind] `` is one of the folders :file: `behavior `, :file: `development `,
335
+ :file: `removals `. See :file: `doc/api/next_api_changes/README.rst ` for more
336
+ information. For the content, you can usually copy the deprecation notice
337
+ and adapt it slightly.
338
+ 2. Change the code functionality and remove any related deprecation warnings.
332
339
333
340
Adding new API
334
341
--------------
0 commit comments