CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

[BUGFIX] Remove deprecated package distutils and use pkg_resources instead.

Open ItamarShalev opened this issue 3 years ago • 0 comments

To avoid warnings of deprecated packages. Please replace the line: from distutils.version import StrictVersion as Version

with: from pkg_resources import parse_version as Version

you can find this line in :

  • customtkinter/windows/ctk_tk.py

  • customtkinter/windows/ctk_toplevel.py

  • customtkinter/windows/widgets/appearance_mode/appearance_mode_tracker.py

Example warning when I run pytest in my project:

=============================== warnings summary =============================== ../../../../../opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/customtkinter/windows/widgets/appearance_mode/appearance_mode_tracker.py:9 ../../../../../opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/customtkinter/windows/widgets/appearance_mode/appearance_mode_tracker.py:9 /opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/customtkinter/windows/widgets/appearance_mode/appearance_mode_tracker.py:9: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if Version(darkdetect.__version__) < Version("0.3.1"):

ItamarShalev avatar Dec 17 '22 19:12 ItamarShalev