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

Use PEP8 style method and function names from pyparsing #29745

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 7 commits into from
Apr 10, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
401F
Development

Successfully merging this pull request may close these issues.

5 participants
0