Skip to content
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

Better compatibility across package versions #623

Open
kafitzgerald opened this issue Nov 5, 2024 · 0 comments
Open

Better compatibility across package versions #623

kafitzgerald opened this issue Nov 5, 2024 · 0 comments
Assignees
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@kafitzgerald
Copy link
Collaborator

I think it'd be worth exploring using something like packaging to give us better compatibility across Matplotlib versions and in doing so make it clear to the reader/user what is being used when and why.

Right now we have a lot of places where the example code only works for a specific narrow range of package versions. Matplotlib in particular has made a lot of API changes we've needed to adapt to and at the moment we're not really tracking this well or doing a great job of making it clear what versions we're compatible with.

Using packaging we could check for a version then provide options for what code to use depending upon the version. A lot of Python packages use this approach. I'm a little hesitant to use it in an example gallery, but I think in our case with so many dependencies and a community where folks are looking for compatibility across a lot of packages and often are slow to update their environments it might be worth it.

Pros:

  • Allows us to have examples that are compatible with a wider range of package versions
  • This includes allowing us to respond to pending upstream changes without breaking compatibility with current versions (see Upstream CI failures #620)

Cons:

  • Adds a dependency (not too worried about this one since it's very commonly used and from PyPA)
  • Would make our example code more verbose in places (don't love this, but I think it's a reasonable tradeoff)

If we decide not to move ahead with this, I think we should strive to be more explicit about what versions our code works with and/or note where there might be issues with backward compatibility.

Open to other suggestions / tools for handling this as well.

@kafitzgerald kafitzgerald added enhancement New feature or request dependencies Pull requests that update a dependency file labels Nov 5, 2024
@kafitzgerald kafitzgerald self-assigned this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant