FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[ENH]: Backend versioning · Issue #30559 · matplotlib/matplotlib · GitHub

Repository navigation

[ENH]: Backend versioning #30559

Closed
Closed

Description

Problem

Beyond our builtin backends there are a few third party ones. It is extremely difficult to evolve the backend API without hard-breaking these third party backends.

Issues with the current state:

Proposed solution

We define a backend version. It unambiguously describes the expected functionality of an interface.

  • The current is version 1.0
  • API changes result in a new backend version.
  • Backends must define the version they are written for. All backends that do not explicitly specify a version are considered to be version 1.0.
  • A Matplotlib version can decide to accept multiple backend versions, e.g. we could at some point accept v1.0, v2.0 and v3.0 and selectively call appropriate functions.
  • We may later decide to drop support for v1.0 in which case we'd reject to load backends of that version.

This should allow to evolve the backend API and third partry backends alongside with grace transition periods so that we maintain maximal compatibility throughout the evolution.

Activity

  1. anntzer commented on Sep 16, 2025

    Contributor

    I think the problem is somewhat worse, because a lot of changes can end up affecting third-party backends even if they are not directly backend-related. To give two concrete examples, #28842 broke mplcairo because it removed implicit ft2font enum->int conversion (by switching to real enums), and #30335 will again break mplcairo (see #30335 (review), note that that conversation is marked as "resolved"). Of course, one approach would be to bump the version number for each of these changes, but e.g. I didn't notice that #28842 would be problematic until after it was merged.
    I wonder whether we should just recommend to backend authors to pin the upper-supported matplotlib version and go through fewer contortions when doing these API changes (while remaining reasonable and avoiding them as much as possible).

  2. timhoffm commented on Sep 16, 2025

    MemberAuthor

    I wonder whether we should just recommend to backend authors to pin the upper-supported matplotlib version

    I don't believe in upper-bound pinning. You cannot pin higher than the current relased version because the next release may be incompatible. This means that backends have to release synced on every Matplotlib release (essentially between the release candidate and the release) to prevent interrupted support for the newest matplotlib version. While interrupted support might be ok for some backends, it would be a serious usability issue for others; e.g. consider the PyCharm backend - it would be awful both for PyCharm and for matplotlib if PyCharm would claim you cannot use the latest version of matplotlib.

    Overall, backends should be free to adopt such a policy if they can reasonably mange it, but we shouldn't make it a general recommendation.

    On changes affecting third-party backends that are not directly backend-related: I think we cannot fully avoid these. The pragmatic approach is to raise awareness on the topic with core devs (could this break third party backends) and otherwise live with the consequences as we have to with any unintended/overlooked API breakage.

    IMHO this all does not diminish the value of a defined evolution of the backend API. - Just because it's not perfect does not mean it's not an improvement.

    Semi-OT: Do we have a full overview of existing backends? If not should we encourage backend developers to announce their backends with us so that we have a clearer picture and possibly up-front communication and maybe even discussion possibilities?

  3. anntzer commented on Sep 16, 2025

    Contributor

    Do we have a full overview of existing backends? If not should we encourage backend developers to announce their backends with us so that we have a clearer picture and possibly up-front communication and maybe even discussion possibilities?

    I think this would be nice to have. Something like "we encourage backend developers to make themselves known; we will ping them on possibly breaking changes to the backend API to give them time to adapt" (this doesn't mean that we wlill necessarily wait for them to fix whatever needs to be fixed on their side, but at least they get a heads up and can participate in the discussion).

  4. timhoffm commented on Sep 16, 2025

    MemberAuthor

    Something like "we encourage backend developers to make themselves known; we will ping them on possibly breaking changes to the backend API to give them time to adapt.

    How could we do this? We need:

    1. a place with a list of known backends. That could be either
    2. a way to communictate. That could be either
      • direct contacts (but may be difficult in terms of privacy)
      • a separate mailing list
      • a GitHub issue, that people can subscribe to
      • posting infos on other platforms like discourse

    I'm inclined to use a Github issue for both. What do you think?

  5. anntzer commented on Sep 16, 2025

    Contributor

    I think third-party backends can indeed register themselves under third-party packages, and a long-running tracking issue to which people can subscribe seems the easiest as well.

  6. timhoffm commented on Sep 29, 2025

    MemberAuthor

    Coming back to the original topic on backend versioning. Now would be a good time to introduce it.

    For as start it is sufficient to just define these and explain how backends declare their version. We do not yet have to query the values in code yet as we have compatibility workarounds. But this would let backends that use the new path collection parameters give a chance to declare they are v2.

    Worst case with introducing now would be that we decide the versioning is not needed and we withdraw the concept again.

  7. added 2 commits that reference this issue on Nov 22, 2025
    57555a5
    61fa0d9
  8. added 4 commits that reference this issue on Dec 13, 2025
    ca972d1
    bc1f4f0
    029449d
    7de667c
  9. added this to the v3.11.0 milestone on Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL