catppuccin / catppuccin/python

_register_styles() fails because mpl.style.core.read_style_directory() is deprecated

Đang mở
#129 0 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
156
Fork
13
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

matplotlib 3.11.0 has [deprecated](https://github.com/matplotlib/matplotlib/blob/main/doc/api/prev_api_changes/api_changes_3.11.0/deprecations.rst) `matplotlib.style.core`, and removed `read_style_directory()` without replacement.

As a result, `import catpuccin` fails with

```
AttributeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import catppuccin

File /venv/jupyter/lib/python3.14/site-packages/catppuccin/__init__.py:96
93 if importlib.util.find_spec("matplotlib") is not None:
94 from catppuccin.extras.matplotlib import _register_colormap_list, _register_styles
---> 96 _register_styles()
97 _register_colormap_list()

File /venv/jupyter/lib/python3.14/site-packages/catppuccin/extras/matplotlib.py:87, in _register_styles()
85 def _register_styles() -> None:
86 """Register the included stylesheets in the mpl style library."""
---> 87 catppuccin_stylesheets = mpl.style.core.read_style_directory( # type: ignore [attr-defined]
88 CATPPUCCIN_STYLE_DIRECTORY
89 )
90 mpl.style.core.update_nested_dict(mpl.style.library, catppuccin_stylesheets)
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start in catppuccin/extras/matplotlib.py at _register_styles(), then reproduce the failure with import catppuccin under matplotlib 3.11. Check the current Matplotlib style-registration APIs and update this integration so the import succeeds and the included stylesheets are registered without using the removed read_style_directory().

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
data-visualization
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.