adamerose / adamerose/PandasGUI

Pandasgui relying on deprecated Setuptools to set __version__

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

Mô tả

[__init__.py](https://github.com/user-attachments/files/25464962/__init__.py)

**Describe the bug**
At runtime, pandasgui throws the following error:
```
.venv\Lib\site-packages\pandasgui\__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import get_distribution
```
I am not technical enough to submit a fix for this in terms of branching, pulling and committin on github but I believe the solution is to replace these lines in pandasgui __init__:
```
# Set version
from pkg_resources import get_distribution
__version__ = get_distribution('pandasgui').version
```

with the following code:
```
from importlib.metadata import version
__version__ = version("pandasgui")
```

This may prove problematic with pandas version < 3.8 and if this is a concern:
```
try:
from importlib.metadata import version
except ImportError:
# For Python < 3.8
from importlib_metadata import version

__version__ = version('pandasgui')
```

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

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.