@@ -62,11 +62,12 @@ team. Generally API deprecation happens in two stages:
62
62
* **expire: ** API *is * changed as described in the introduction period
63
63
64
64
This ensures that users are notified before the change will take effect and thus
65
- prevents unexpected breaking of code.
65
+ prevents unexpected breaking of code. Occasionally deprecations are marked as
66
+ **pending **, which means that the deprecation will be introduced in a future release.
66
67
67
68
Rules
68
69
^^^^^
69
- - Deprecations are targeted at the next:ref: `meso release <pr-milestones >` (e.g. 3.x )
70
+ - Deprecations are targeted at the next:ref: `meso release <pr-milestones >` (e.g. 3.Y )
70
71
- Deprecated API is generally removed (expired) two point-releases after introduction
71
72
of the deprecation. Longer deprecations can be imposed by core developers on
72
73
a case-by-case basis to give more time for the transition
@@ -76,12 +77,17 @@ Rules
76
77
- If in doubt, decisions about API changes are finally made by the
77
78
`API consistency lead <https://matplotlib.org/governance/people.html >`_ developer.
78
79
80
+
79
81
.. _intro-deprecation :
80
82
81
83
Introduce deprecation
82
84
^^^^^^^^^^^^^^^^^^^^^
83
85
84
- #. Create:ref: `deprecation notice <api_whats_new >`
86
+ Deprecations are introduced to warn users that the API will change. The deprecation
87
+ notice describes how the API will change. When alternatives to the deprecated API exist,
88
+ they are also listed in the notice and decorators.
89
+
90
+ #. Create a:ref: `deprecation notice <api_whats_new >`
85
91
86
92
#. If possible, issue a `~matplotlib.MatplotlibDeprecationWarning ` when the
87
93
deprecated API is used. There are a number of helper tools for this:
@@ -117,8 +123,10 @@ Introduce deprecation
117
123
118
124
Expire deprecation
119
125
^^^^^^^^^^^^^^^^^^
126
+ The API changes described in the introduction notice are only implemented after the
127
+ introduction period has expired.
120
128
121
- #. Create:ref: `deprecation announcement <api_whats_new >`. For the content,
129
+ #. Createa :ref: `deprecation announcement <api_whats_new >`. For the content,
122
130
you can usually copy the deprecation notice and adapt it slightly.
123
131
124
132
#. Change the code functionality and remove any related deprecation warnings.
@@ -137,6 +145,35 @@ Expire deprecation
137
145
instead. For removed items that were not in the stub file, only deleting from the
138
146
allowlist is required.
139
147
148
+ .. _pending-deprecation :
149
+
150
+ Pending deprecation
151
+ ^^^^^^^^^^^^^^^^^^^
152
+
153
+ A pending deprecation is an announcement that a deprecation will be introduced in the
154
+ future. By default, pending deprecations do not raise a warning to the user; however,
155
+ pending deprecations are rendered in the documentation and listed in the release notes.
156
+ Pending notices are primarily intended to give downstream library and tool developers
157
+ time to adapt their code so that it does not raise a deprecation
158
+ warning. This is because their users cannot act on warnings triggered by how the tools
159
+ and libraries use Matplotlib. It's also possible to run Python in dev mode to raise
160
+ `PendingDeprecationWarning `.
161
+
162
+ To mark a deprecation as pending, set the following parameters on the appropriate
163
+ deprecation decorator:
164
+ * the *pending * parameter is set to ``True ``
165
+ * the *removal * parameter is left blank
166
+
167
+ When converting a pending deprecation to an introduced deprecation, update the
168
+ decorator such that:
169
+ * *pending * is set to ``False ``
170
+ * *since * is set to the next meso release (3.Y+1)
171
+ * *removal * is set to at least 2 meso releases after (3.Y+3) introduction.
172
+
173
+ Pending deprecations are documented in the:ref: `API change notes <api_whats_new >` in
174
+ the same manner as introduced and expired deprecations. The notice should include
175
+ *pending deprecation * in the title.
176
+
140
177
141
178
..redirect-from ::/devel/coding_guide#new-features-and-api-changes
142
179