The issue is caused because commoncode does not properly set the supported range for its dependency on click, as can be seen here:
As such when installing commoncode, the most recent version of click is installed, which happens to be incompatible. The commoncode attempts to access is_hidden on EnhancedProgressBar which inherits from click's ProgressBar. As the attribute has been renamed from is_hidden to hidden this fails.
Setup plugins...
Collect file inventory...
Scan files for: info, licenses, copyrights, emails, urls with 4 process(es)...
Removing temporary files...done.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\user\01-data\10-git\test\venv\Scripts\scancode.exe\__main__.py", line 7, in <module>
sys.exit(scancode())
~~~~~~~~^^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\click\core.py", line 1442, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\commoncode\cliutils.py", line 73, in main
return click.Command.main(
~~~~~~~~~~~~~~~~~~^
self,
^^^^^
...<4 lines>...
**extra,
^^^^^^^^
)
^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\click\core.py", line 1363, in main
rv = self.invoke(ctx)
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\click\core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\click\core.py", line 794, in invoke
return callback(*args, **kwargs)
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\click\decorators.py", line 34, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\scancode\cli.py", line 487, in scancode
success, _results = run_scan(
~~~~~~~~^
input=input,
^^^^^^^^^^^^
...<20 lines>...
**kwargs
^^^^^^^^
)
^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\scancode\cli.py", line 944, in run_scan
scan_success = run_scanners(
stage='scan',
...<8 lines>...
echo_func=echo_func,
)
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\scancode\cli.py", line 1186, in run_scanners
scan_success = scan_codebase(
codebase, scanners, processes, timeout,
with_timing=timing, progress_manager=progress_manager)
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\scancode\cli.py", line 1285, in scan_codebase
scans.__enter__()
~~~~~~~~~~~~~~~^^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\click\_termui_impl.py", line 118, in __enter__
self.render_progress()
~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\user\01-data\10-git\test\venv\Lib\site-packages\commoncode\cliutils.py", line 199, in render_progress
if not self.is_hidden:
^^^^^^^^^^^^^^
AttributeError: 'EnhancedProgressBar' object has no attribute 'is_hidden'. Did you mean: 'hidden'?
Update:
The issue is caused because commoncode does not properly set the supported range for its dependency on click, as can be seen here:
commoncode/setup.cfg
Line 45 in aba7c1b
The package click has changed its
ProgressBarimplementation in commit pallets/click@fcd8503 which is part of the 8.2.0 release.As such when installing commoncode, the most recent version of click is installed, which happens to be incompatible. The commoncode attempts to access
is_hiddenonEnhancedProgressBarwhich inherits from click'sProgressBar. As the attribute has been renamed fromis_hiddentohiddenthis fails.Running scancode-toolkit on Windows throws an exception when not using the
--quietoption. This is particularly strange, because I am fairly certain that the same version of scancode-toolkit worked just a couple of days ago.Using: