@@ -285,8 +285,12 @@ Coding guidelines
285
285
API changes
286
286
-----------
287
287
288
- Changes to the public API must follow a standard deprecation procedure to
289
- prevent unexpected breaking of code that uses Matplotlib.
288
+ Generally, API consistency and stability are of great value. Therefore, API
289
+ changes (e.g. Removals, Behavior Changes) should only be conducted if the
290
+ resulting value is worth the effort. Deprecating an API before changing it
291
+ (marking it as outdated) is therefore mandatory and done in accordance with
292
+ a standard Deprecation procedure to prevent unexpected breaking of code that
293
+ uses Matplotlib.
290
294
291
295
- Definition of Deprecation
292
296
- Deprecations are Announcements of future changes, stating that the status
@@ -299,27 +303,31 @@ prevent unexpected breaking of code that uses Matplotlib.
299
303
which release forward the argument will be removed.
300
304
301
305
- Deprecation Process
302
- - Deprecations must be announced via a new file in a new file in
303
- :file: `doc/api/next_api_changes/deprecations/ ` with naming convention
304
- ``99999-ABC.rst `` where ``99999 `` is the pull request number and ``ABC ``
305
- are the contributor's initials.
306
- - Deprecations are targeted at the next point-release (i.e. 3.x.0).
307
- - The deprecated API should, to the maximum extent possible, remain fully
308
- functional during the deprecation period. In cases where this is not
309
- possible, the deprecation must never make a given piece of code do something
310
- different than it was before; at least an exception should be raised.
311
- - If possible, usage of a deprecated API should emit a
312
- `.MatplotlibDeprecationWarning `. There are a number of helper tools for this:
313
-
314
- - Use ``_api.warn_deprecated() `` for general deprecation warnings.
315
- - Use the decorator ``@_api.deprecated `` to deprecate classes, functions,
316
- methods, or properties.
317
- - To warn on changes of the function signature, use the decorators
318
- ``@_api.delete_parameter ``, ``@_api.rename_parameter ``, and
319
- ``@_api.make_keyword_only ``.
320
-
321
- - Deprecated API may be removed two point-releases after they were deprecated.
322
-
306
+ - Rules
307
+ - Deprecations are targeted at the next point.release (e.g. 3.x.0)
308
+ - Deprecated API may be removed two point-releases after their initial
309
+ Deprecation
310
+ - The old API must remain fully functional during the Deprecation period
311
+ - If valid alternatives to the deprecated API exist, they should be available
312
+ during the Deprecation period
313
+ - If in doubt, decisions about API changes are finally made by the
314
+ API consistency lead developer
315
+ - Process Schema
316
+ 1. Deprecation Announcement via a new file in a new file in
317
+ :file: `doc/api/next_api_changes/deprecations/ ` with naming convention
318
+ ``99999-ABC.rst `` where ``99999 `` is the pull request number and ``ABC ``
319
+ are the contributor's initials
320
+ 2. Deprecations are then targeted at the next point-release (e.g. 3.x.0)
321
+ 3. The continuing usage of a deprecated API should result in a
322
+ Runtime Warming (`.MatplotlibDeprecationWarning `). There are a number
323
+ of helper tools for this:
324
+ - Use ``_api.warn_deprecated() `` for general deprecation warnings
325
+ - Use the decorator ``@_api.deprecated `` to deprecate classes, functions,
326
+ methods, or properties
327
+ - To warn on changes of the function signature, use the decorators
328
+ ``@_api.delete_parameter ``, ``@_api.rename_parameter ``, and
329
+ ``@_api.make_keyword_only ``
330
+ 4. Deprecated API gets removed two point-releases after initial Deprecation
323
331
324
332
Adding new API
325
333
--------------
0 commit comments