8000 Use PEP8 style method and function names from pyparsing by dstansby · Pull Request #29745 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Conversation

dstansby
Copy link
Member

PR summary

See #29722 for context, this prepares for a pyparsing 3.3.0 release. This requires a bump of the minimum version to 3.0. That was released in 2021, so is easily within our dependency policy of at >= 12 months.

PR checklist

@dstansby dstansby changed the title Use PEP8 names from pyparsing Use PEP8 style method and function names from pyparsing Mar 12, 2025
@ptmcg
Copy link
ptmcg commented Mar 13, 2025

Note that pyparsing 3.0 requires Python 3.6 or later.

@ptmcg
Copy link
ptmcg commented Mar 13, 2025

I also discovered that there are several non-PEP8 attributes on ParserElement, specifically resultsName - which has a couple of referenes in matplotlib. As I did not set up the PEP8 synonyms for that attribute (or several others), it will unfortunately remain. (Since it has no leading underscore, it is fair game for users to assume it is part of the public API - an important lesson learned...)

I'll implement the synonyms for resultsName and the other non-PEP8 public attributes in 3.3.0 or possibly even 3.2.2, but they will not emit the DeprecationWarnings until at least 4.0.

@timhoffm
Copy link
Member
timhoffm commented Mar 13, 2025

Note that pyparsing 3.0 requires Python 3.6 or later.

Thanks for the hint. I think it's not a problem in practice. Per our dependency policy we are requiring
3.10 in the current version of Matplotlib. The latest version not requiring Python 3.6+ is matplotlib 3.0 (released in 2018). That is the latest version one can possibly break. But even there, you'd have to explicitly pin python to < 3.6; and if you really want to run such an old version and pin python as well, I think it's bearable for these users that they have to pin pyparsing as well - while there is no upward pinning that could prevent installing the latest pyparsing, you cannot expect that a mixture of pinned very old packages necessarly works with the latest versions of other dependencies.

@tacaswell
Copy link
Member

At the library level we should provide functional floors to our version pinning (using caps only if we know it will break us) and leave retro-actively adjusting pins to packagers / integrators.

@dstansby dstansby marked this pull request as ready for review March 26, 2025 17:34
@dstansby dstansby force-pushed the pyparsing-method-names branch from 705a3a3 to 82cf793 Compare March 31, 2025 17:56
@dstansby dstansby added this to the v3.11.0 milestone Mar 31, 2025
@timhoffm
Copy link
Member
timhoffm commented Apr 9, 2025

Do you want to keep commits or should this be squashed? - Either way, you can merge yourself.

@dstansby dstansby merged commit d55bdde into matplotlib:main Apr 10, 2025
41 checks passed
@dstansby dstansby deleted the pyparsing-method-names branch April 10, 2025 06:41
@ptmcg
Copy link
ptmcg commented Sep 20, 2025

I'm about to release pyparsing 3.3.0 next month, but the latest 3.10.6 release of matplotlib still emits DeprecationWarnings. I thought this work got merged in - I guess "merged" doesn't necessarily mean "goes out in the next release." How can I coordinate my 3.3.0 release with matplotlib to head off a storm of "I'm getting DeprecationWarnings now!" reports?

@timhoffm
Copy link
Member

Thanks for the heads-up. We are a bit later than originally planned with the 3.11 release, but should possibly have put the changes in the 3.10.x bugfix releases. I'll do that now, but I'm unsure whether we'll still do a 3.10.7. Eithe way, we need to coordinate, because we indeed don't want the deprecation warnings to show up with users.

@timhoffm

This comment was marked as outdated.

This comment was marked as outdated.

@timhoffm

This comment was marked as outdated.

This comment was marked as outdated.

timhoffm pushed a commit to timhoffm/matplotlib that referenced this pull request Sep 20, 2025
…s from

pyparsing

* Bump minimum pyparsing version

* Use PEP8 method names from pyparsing

* Add api note

* Clean up pyparsing<3 code

* Remove unused import

* Clean up pyparsing import

* Sort imports

(cherry picked from commit d55bdde)
@ptmcg
Copy link
ptmcg commented Sep 20, 2025

we need to coordinate, because we indeed don't want the deprecation warnings to show up with users.

Will definitely do so. I have a set of matplotlib tests as part of my unit tests, so that I can see this before releasing.

ksunden pushed a commit that referenced this pull request Oct 2, 2025
…0589)

* Backport PR #29745: Use PEP8 style method and function names from
pyparsing

* Bump minimum pyparsing version

* Use PEP8 method names from pyparsing

* Add api note

* Clean up pyparsing<3 code

* Remove unused import

* Clean up pyparsing import

* Sort imports

(cherry picked from commit d55bdde)

* Remove erroneous pillow bump

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>

* Update pyproject.toml

Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>

---------

Co-authored-by: David Stansby <dstansby@gmail.com>
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@ksunden ksunden mentioned this pull request Oct 9, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0