Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Remove deprecated code from _fontconfig_patterns#26884

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ksunden merged 1 commit intomatplotlib:mainfromjsjeelshah:gridspec
Jan 8, 2024

Conversation

jsjeelshah
Copy link
Contributor

@jsjeelshahjsjeelshah commentedSep 22, 2023
edited
Loading

PR summary

This PR removes the deprecated code during the version 3.7 from lib/matplotlib/gridspec.py and lib/matplotlib/_fontconfig_patterns.py issues here:#26865.

PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@jsjeelshahjsjeelshah marked this pull request as ready for reviewSeptember 22, 2023 23:26
@QuLogicQuLogic added this to thev3.9.0 milestoneSep 23, 2023
Comment on lines -101 to -105
_api.warn_deprecated(
"3.7", message=f"Support for unknown constants "
f"({prop[0]!r}) is deprecated since %(since)s and "
f"will be removed %(removal)s.")
continue
Copy link
Member

Choose a reason for hiding this comment

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

This should raise an error now.

@ksundenksunden mentioned this pull requestSep 25, 2023
14 tasks
@QuLogic
Copy link
Member

Thegridspec part was done in#26885; can you please rebase this and focus only on the_fontconfig_patterns part?

@0taj
Copy link
Contributor

Hello, would I be able to work on this issue?

@melissawm
Copy link
Member

Hi@0taj - this is an open pull request, meaning that another contributor is already working on it. Feel free to look at the other open issues on the repo, in particular those markedgood first issue. Cheers!

@QuLogic
Copy link
Member

In the interest of completing this PR, I've done the rebase and pushed it here.

@QuLogicQuLogic changed the titleremoved deprecated code from gridspec.py and _fontconfig_patterns.pyRemove deprecated code from _fontconfig_patternsDec 6, 2023
@QuLogic
Copy link
Member

QuLogic commentedDec 6, 2023
edited
Loading

Also pusheda fix to my comment at#26884 (comment)

@anntzer
Copy link
Contributor

Actually the patch should be

diff --git a/lib/matplotlib/_fontconfig_pattern.py b/lib/matplotlib/_fontconfig_pattern.pyindex d3933b9f39..6e3c55d2b2 100644--- a/lib/matplotlib/_fontconfig_pattern.py+++ b/lib/matplotlib/_fontconfig_pattern.py@@ -13,7 +13,7 @@ from functools import lru_cache, partial import re from pyparsing import (-    Group, Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore)+    oneOf, Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore) from matplotlib import _api@@ -63,8 +63,7 @@ def _make_fontconfig_parser():     size = Regex(r"([0-9]+\.?[0-9]*|\.[0-9]+)")     name = Regex(r"[a-z]+")     value = Regex(fr"([^{_value_punc}]|(\\[{_value_punc}]))*")-    # replace trailing `| name` by oneOf(_CONSTANTS) in mpl 3.9.-    prop = Group((name + Suppress("=") + comma_separated(value)) | name)+    prop = (name + Suppress("=") + comma_separated(value)) | oneOf(_CONSTANTS)     return (         Optional(comma_separated(family)("families"))         + Optional("-" + comma_separated(size)("sizes"))@@ -97,12 +96,6 @@ def parse_fontconfig_pattern(pattern):         props["size"] = [*parse["sizes"]]     for prop in parse.get("properties", []):         if len(prop) == 1:-            if prop[0] not in _CONSTANTS:-                _api.warn_deprecated(-                    "3.7", message=f"Support for unknown constants "-                    f"({prop[0]!r}) is deprecated since %(since)s and "-                    f"will be removed %(removal)s.")-                continue             prop = _CONSTANTS[prop[0]]         k, *v = prop         props.setdefault(k, []).extend(map(_value_unescape, v))diff --git a/lib/matplotlib/tests/test_fontconfig_pattern.py b/lib/matplotlib/tests/test_fontconfig_pattern.pyindex 792a8ed517..496a35b95c 100644--- a/lib/matplotlib/tests/test_fontconfig_pattern.py+++ b/lib/matplotlib/tests/test_fontconfig_pattern.py@@ -73,5 +73,5 @@ def test_fontconfig_str(): def test_fontconfig_unknown_constant():-    with pytest.warns(DeprecationWarning):+    with pytest.raises(ValueError, match="ParseException"):         FontProperties(":unknown")

(in particular switching to oneOf makes it unnecessary to have a checked-getitem).

@QuLogic
Copy link
Member

Ah, good point.

@QuLogic
Copy link
Member

I've rebased and corrected the API note.

@anntzeranntzer mentioned this pull requestJan 4, 2024
5 tasks
@ksundenksunden merged commit843f585 intomatplotlib:mainJan 8, 2024
@ksunden
Copy link
Member

@jsjeelshah Thank you and congrats on your first merged PR! Hope to hear from you again!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@anntzeranntzeranntzer approved these changes

Assignees
No one assigned
Projects
Milestone
v3.9.0
Development

Successfully merging this pull request may close these issues.

6 participants
@jsjeelshah@QuLogic@0taj@melissawm@anntzer@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp