Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Doc: document pending deprecation procedure #29375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

story645
Copy link
Member

PR summary

In #29152 (comment) @rcomer flagged that the pending deprecation procedure wasn't documented, so I tried to write up what I inferred from her comment to be the procedure.

PR checklist

@github-actions github-actions bot added the Documentation: devdocs files in doc/devel label Dec 23, 2024
@story645 story645 force-pushed the api-change branch 2 times, most recently from 1b37fdf to 8e95d75 Compare December 23, 2024 03:30
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we’re mixing two aspects here.

  • when doing an API migration (“use this instead of that”) it can be helpful to have a version in which both APIs exists without without warning. This helps to write code that does not emit warnings and supports multiple versions without explicit version gating. It’s primarily helping downstream libraries who can’t aggressively pin matplotlib to recent releases.
  • pending deprecations are specifically about heads-up notifications to downstream libraries, so that they can update their cod. A user should typically not see a deprecation from a library, because they cannot fix it (other than updating to a new library version, which requires the library author to know about the deprecation before it’s regularly raised.)

There’s an overlap between the two, but they are not identical. For example, one could/should raise a pending depreciation warning for API removals.

Overall, the question of pending depreciations and migrations with a non-raising intermediate version is a trade off between how smooth the transition should be and how much effort and migration time we want to invest.

I haven’t completely thought this through. Some aspects to consider:

  • Nightly builds are an alternative way to give an heads-up. They can party replace pending depreciations. But that’s something typically only larger projects do. Also with that mechanism, changes should not be introduced in right before a release, because that reduces reaction time.
  • Sometimes we may just/or additionally notify “known users” if they are limited. Think: projections -> cartopy or rarely used APO -> GitHub code search results
  • The procedure may also depend on the expected frequency of use. It may be ok if users see a warning from a not—commonly used function in seaborn, but it’s not ok if we make every function of the current seaborne release emit a warning.
  • It can also depend on whether it’s just a cleanup (longer transitions are feasible) or it’s an enabler for upcoming changes (we don’t want to wait too long to introduce them)
  • I’ve not competently thought through all migration aspects for downstream libs: How does their release schedules and matplotlib version requirements strategy interplay with above deprecation strategies? Does the combination still deliver on the intended goals?

This has to be thought through carefully, otherwise we may complicate and delay our depreciations and thus the ability to improve without adding substantial benefit.

Overall, our current way of working seems not too bad. At least I’m not aware of complaints. We’re doing transition versions and pending depreciations on a case-by-case basis. It’s reasonable to document that they exist and what they are for, with a suggestion when to use them. But roughly, I don’t have the feeling we need to use them more often.

@rcomer
Copy link
Member

rcomer commented Dec 23, 2024

I’ve not competently thought through all migration aspects for downstream libs: How does their release schedules and matplotlib version requirements strategy interplay with above deprecation strategies?

In Cartopy we follow SPEC0 so I think the new API would need to be around for a couple of years for us to transition without version gating. Having said that, I think most of the recent version gates in Cartopy are either for things that MPL can’t reasonably provided a transition pathway for (e.g new structure of ContourSet) or code that takes advantage of new MPL features. So perhaps the Cartopy experience is not so relevant here.

@timhoffm
Copy link
Member

Yes this is one of the aspects to consider. In such cases, you typically can’t completely circumvent version gating. Nevertheless it may help to give downstream libs more time to implement the version gating.

@timhoffm timhoffm added the status: needs comment/discussion needs consensus on next step label Jan 20, 2025
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When exactly to use pending deprecations is a complex topic, see #29375 (review). To move forward and not get stuck on details, I suggest to leave out the exact definition on when we apply pending deprecations for now.

doc/devel/api_changes.rst Outdated Show resolved Hide resolved
doc/devel/api_changes.rst Outdated Show resolved Hide resolved
doc/devel/api_changes.rst Outdated Show resolved Hide resolved
doc/devel/api_changes.rst Outdated Show resolved Hide resolved
doc/devel/api_changes.rst Outdated Show resolved Hide resolved
Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@story645
Copy link
Member Author

Also added mini blurbs to introduce and expire to match the blurb for pending

@timhoffm timhoffm removed the status: needs comment/discussion needs consensus on next step label Jan 22, 2025
@timhoffm timhoffm added this to the v3.11.0 milestone Jan 22, 2025
@timhoffm timhoffm merged commit 3703110 into matplotlib:main Jan 22, 2025
22 of 23 checks passed
@story645 story645 deleted the api-change branch January 22, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: devdocs files in doc/devel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.