enthought / enthought/traitsui

Missing dependencies in the environment lead to unintuitive error messages

Open
#1,405 1 comment 0 reactions 0 assignees View on GitHub
component: build
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

The Traitsui cron job is failing - https://travis-ci.com/github/enthought/traitsui/builds/202685048 - and this is because of the recent changes in pyface which made `importlib-resources` and `importlib-metadata` dependencies of pyface - but those packages are not installed in the traitsui devenv.

The problem here is that the missing dependencies are not reported as such - and instead, we get a cryptic/unintuitive error message when we run the testsuite for an environment with a toolkit (non-null backend). With the null backend, it is abundantly clear that there is a missing dependency and we see the appropriate exception about a missing dependency in the environment.

```
$ for toolkit in ${TOOLKITS}; do edm run -- python etstool.py test --runtime=${RUNTIME} --toolkit=${toolkit} || exit; done
Running tests in 'traitsui-test-3.6-pyqt'
copying file to tempdir: .coveragerc
[EXECUTING] edm run -e traitsui-test-3.6-pyqt -- python -W default -m coverage run -p -m unittest discover -v traitsui
traitsui (unittest.loader._FailedTest) ... ERROR
======================================================================
ERROR: traitsui (unittest.loader._FailedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traitsui/__init__.py", line 84, in load_tests
toolkit()
File "/home/travis/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/traitsui/toolkit.py", line 113, in toolkit
_toolkit = find_toolkit("traitsui.toolkits")
File "/home/travis/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/pyface/base_toolkit.py", line 282, in find_toolkit
return import_toolkit(ETSConfig.toolkit, entry_point)
File "/home/travis/.edm/envs/traitsui-test-3.6-pyqt/lib/python3.6/site-packages/pyface/base_toolkit.py", line 246, in import_toolkit
raise RuntimeError(msg)
RuntimeError: No traitsui.toolkits plugin could be loaded for qt4
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
Command '['edm', 'run', '-e', 'traitsui-test-3.6-pyqt', '--', 'python', '-W', 'default', '-m', 'coverage', 'run', '-p', '-m', 'unittest', 'discover', '-v', 'traitsui']' returned non-zero exit status 1.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.