I have ward
installed in a virtual environment on Python 3.7.5, and I'm getting the following error when executing the ward
command in the root of my repository. My code lives in a package omission
directly in this repository, and that package contains subpackages and submodules configured as tests.
Here are the versions of the packages installed in my virtual environment:
- GitPython-3.1.0
- PyYAML-5.3.1
- appdirs-1.4.3
- bandit-1.6.2
- click-7.1.1
- colorama-0.3.9
- cucumber-tag-expressions-2.0.4
- entrypoints-0.3
- flake8-3.7.9
- gitdb-4.0.2
- mccabe-0.6.1
- pbr-5.4.4
- pprintpp-0.4.0
- pycodestyle-2.5.0
- pyflakes-2.1.1
- pygments-2.6.1
- pyside2-5.14.1
- shiboken2-5.14.1
- six-1.14.0
- smmap-3.0.1
- stevedore-1.32.0
- termcolor-1.1.0
- toml-0.9.6
- ward-0.42.0b0
Here's the error I'm encountering:
(venv) jason@tardis:omission$ ward
Traceback (most recent call last):
File "/home/jason/Code/Repositories/omission/venv/bin/ward", line 10, in <module>
sys.exit(run())
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/run.py", line 115, in run
modules = list(load_modules(mod_infos))
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/collect.py", line 109, in load_modules
m.__loader__.exec_module(m)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "venv/lib/python3.7/site-packages/git/test/test_diff.py", line 7, in <module>
import ddt
ModuleNotFoundError: No module named 'ddt'
After installing ddt
manually (ddt-1.3.1
), I get this error instead when running ward
:
Traceback (most recent call last):
File "/home/jason/Code/Repositories/omission/venv/bin/ward", line 10, in <module>
sys.exit(run())
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/run.py", line 115, in run
modules = list(load_modules(mod_infos))
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/collect.py", line 109, in load_modules
m.__loader__.exec_module(m)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "venv/lib/python3.7/site-packages/git/test/performance/test_commit.py", line 11, in <module>
from .lib import TestBigRepoRW
ImportError: attempted relative import with no known parent package
Interestingly, if I install pytest
as well, the error on ward
changes yet again:
Traceback (most recent call last):
File "/home/jason/Code/Repositories/omission/venv/bin/ward", line 10, in <module>
sys.exit(run())
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/run.py", line 115, in run
modules = list(load_modules(mod_infos))
File "/home/jason/Code/Repositories/omission/venv/lib/python3.7/site-packages/ward/collect.py", line 109, in load_modules
m.__loader__.exec_module(m)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "venv/lib/python3.7/site-packages/importlib_metadata/tests/test_api.py", line 5, in <module>
from . import fixtures
ImportError: attempted relative import with no known parent package
For the record, installing pytest
as well installs the following:
- attrs-19.3.0
- importlib-metadata-1.6.0
- more-itertools-8.2.0
- packaging-20.3
- pluggy-0.13.1
- py-1.8.1
- pyparsing-2.4.6
- pytest-5.4.1
- wcwidth-0.1.9
- zipp-3.1.0
bug