@@ -62,26 +62,32 @@ 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.
67
+ Pending deprecations are noted in the documentation but do not raise a warning to the
68
+ user.
66
69
67
70
Rules
68
71
^^^^^
69
- - Deprecations are targeted at the next:ref: `meso release <pr-milestones >` (e.g. 3.x )
72
+ - Deprecations are targeted at the next:ref: `meso release <pr-milestones >` (e.g. 3.Y )
70
73
- Deprecated API is generally removed (expired) two point-releases after introduction
71
74
of the deprecation. Longer deprecations can be imposed by core developers on
72
75
a case-by-case basis to give more time for the transition
73
76
- The old API must remain fully functional during the deprecation period
74
77
- If alternatives to the deprecated API exist, they should be available
75
78
during the deprecation period
79
+ - If the deprecation is introduced as part of implementing an alternative, then it
80
+ should be marked pending.
76
81
- If in doubt, decisions about API changes are finally made by the
77
82
`API consistency lead <https://matplotlib.org/governance/people.html >`_ developer.
78
83
84
+
79
85
.. _intro-deprecation :
80
86
81
87
Introduce deprecation
82
88
^^^^^^^^^^^^^^^^^^^^^
83
89
84
- #. Create:ref: `deprecation notice <api_whats_new >`
90
+ #. Createa :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:
@@ -118,7 +124,7 @@ Introduce deprecation
118
124
Expire deprecation
119
125
^^^^^^^^^^^^^^^^^^
120
126
121
- #. Create:ref: `deprecation announcement <api_whats_new >`. For the content,
127
+ #. Createa :ref: `deprecation announcement <api_whats_new >`. For the content,
122
128
you can usually copy the deprecation notice and adapt it slightly.
123
129
124
130
#. Change the code functionality and remove any related deprecation warnings.
@@ -137,6 +143,30 @@ Expire deprecation
137
143
instead. For removed items that were not in the stub file, only deleting from the
138
144
allowlist is required.
139
145
146
+ .. _pending-deprecation :
147
+
148
+ Pending deprecations
149
+ ^^^^^^^^^^^^^^^^^^^^
150
+
151
+ If the deprecation is introduced as part of implementing an alternative, then the
152
+ deprecation is marked as pending and introduced one meso release after the feature.
153
+
154
+ For example, if the feature is released in 3.Y, then code that should be deprecated
155
+ because of the feature is marked with the appropriate deprecation decorator and
156
+ the following settings:
157
+ * the *pending * parameter is set to ``True ``
158
+ * the *removal * parameter is left blank
159
+
160
+ Once the version with the feature (e.g. 3.Y) has been released, the pending deprecation
161
+ is introduced. The decorator should be updated such that:
162
+ * *pending * is set to ``False ``
163
+ * *since * is set to the next meso release (3.Y+1)
164
+ * *removal * is set to at least 2 versions after (3.Y+3) introduction.
165
+
166
+ Pending deprecations are documented in the:ref: `API change notes <api_whats_new >` in
167
+ the same manner as introduced and expired deprecations. The notice should include
168
+ *pending deprecation * in the title.
169
+
140
170
141
171
..redirect-from ::/devel/coding_guide#new-features-and-api-changes
142
172