Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the release of traits 6.2 a section was added to the documentation explicitly requesting users to import from the
.api
modules in traits. See PR enthought/traits#1387Motivated by this I decided to run through pyface looking for any non api imports from traits. This PR updates a couple (namely it always imports
UnittestTools
from thetraits.testing.api
andETSConfig
fromtraitst.etsconfig.api
.However, I ran into many more examples of traits imports of things not exposed in traits apis. It is known that this is done but I figured it couldn't hurt to compile a list. It may be fine to leave them as is, some of these we may want to expose in some traits api, some of them we may not want to be pulling from traits (traits isn't meant to be a storage place for miscellaneous utilities). This list probably warrants being in a separate or multiple separate issues which I can gladly open eventually. For now these are the imports I found:
From
traits.trait_base
there are imports of:xgetattr
xsetattr
get_resource_path
user_name_for
traits_home
Additionally we import optional dependencies from
traits.testing.optional_dependencies
From
traits.trait_list_object
we importTraitsList
but this is a differentTraitList
from the one exposed intraits.api
from
traits.version
we importversion
from
traits.util.resource
we importget_path
form
traitst.trait_notifiers
we importset_ui_handler
andui_handler
from
traitss.util.clean_strings
we importpython_name
and from
traits.util.camel_case
we importcamel_case_to_words