Skip to content

Commit

Permalink
MAINT: replace deprecated version check for traitsui (#1746)
Browse files Browse the repository at this point in the history
In traitsui, traitsui.__version__ has been deprecated and should be
replaced with importlib.metadata.version('traitsui'). The deprecation
warning raised have also caused test_edit_not_given in
traits/traits/tests/test_configure_traits.py to fail as mentioned in
#1745 . Since the version check is a temporary check to address the
dependency of traits on traits ui and is no longer need, the current PR
fixed this issue by removing all version checks related to
_traitsui_helpers.py.

Closes #1745

Co-authored-by: Chengyu Liu <cyliu@aus552cyliu.local>
  • Loading branch information
homosapien-lcy and Chengyu Liu committed Apr 21, 2023
1 parent dcbefb4 commit 60f918e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 86 deletions.
5 changes: 0 additions & 5 deletions traits/has_traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
)
from .trait_errors import TraitError
from .util.deprecated import deprecated
from .util._traitsui_helpers import check_traitsui_major_version
from .trait_converters import check_trait, mapped_trait_for, trait_for


Expand Down Expand Up @@ -1846,10 +1845,6 @@ def _trait_view(
if view_elements is None:
return None

# Provide a nicer failure mode when upgrading to Traits using
# TraitsUI 6.x
check_traitsui_major_version(7)

if name:
if view_element is None:
# If only a name was specified, return the ViewElement it
Expand Down
40 changes: 0 additions & 40 deletions traits/util/_traitsui_helpers.py

This file was deleted.

41 changes: 0 additions & 41 deletions traits/util/tests/test_traitsui_helpers.py

This file was deleted.

0 comments on commit 60f918e

Please sign in to comment.