jazzband / Watson

:watch: A wonderful CLI to track your time!
http://tailordev.github.io/Watson/
MIT License
2.46k stars 240 forks source link

Crash in virtual env on Windows 10, in powershell #448

Closed KennethNielsen closed 3 years ago

KennethNielsen commented 3 years ago

Dear watson devs

I just tried installing watson inside a virtual environment on 10 in powershell. The virtual env was freshly created and the only thing I did with it was to activate it and install watson. After installation, when trying to call watson I get the following traceback:

Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\venv\watson\Scripts\watson.exe\__main__.py", line 4, in <module>
  File "c:\venv\watson\lib\site-packages\watson\__main__.py", line 1, in <module>
    from watson import cli
  File "c:\venv\watson\lib\site-packages\watson\cli.py", line 529, in <module>
    def report(watson, current, from_, to, projects, tags, ignore_projects,
  File "c:\venv\watson\lib\site-packages\click\decorators.py", line 247, in decorator
    _param_memo(f, OptionClass(param_decls, **option_attrs))
  File "c:\venv\watson\lib\site-packages\watson\cli.py", line 46, in __init__
    super(MutuallyExclusiveOption, self).__init__(*args, **kwargs)
  File "c:\venv\watson\lib\site-packages\click\core.py", line 2482, in __init__
    super().__init__(param_decls, type=type, multiple=multiple, **attrs)
  File "c:\venv\watson\lib\site-packages\click\core.py", line 2108, in __init__
    raise ValueError(
ValueError: 'default' must be a list when 'multiple' is true.

Versions:

(watson) PS C:\venv\watson> pip show click td-watson                                                                    Name: click
Version: 8.0.1
Summary: Composable command line interface toolkit
Home-page: https://palletsprojects.com/p/click/
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD-3-Clause
Location: c:\venv\watson\lib\site-packages
Requires: colorama
Required-by: td-watson, click-didyoumean
---
Name: td-watson
Version: 2.0.1
Summary: A wonderful CLI to track your time!
Home-page: https://github.com/TailorDev/Watson
Author: TailorDev
Author-email: contact@tailordev.fr
License: MIT
Location: c:\venv\watson\lib\site-packages
Requires: arrow, colorama, requests, click-didyoumean, click
Required-by:
(watson) PS C:\venv\watson> python --version                                                                            Python 3.9.1

It seems the problem is that a click type is instantiated with some bad arguments. I can do some more troubleshooting to try and figure out what it is called with, but I was curious whether anyone had any ideas.

anna-brosowsky commented 3 years ago

According to #430, there is some kind of issue with click version 8. I fixed it (on linux) by downgrading click to 7.1.2, but there also seems to be a fix implemented in #432 (basically, multiple=True needs to be removed from several click options).

jmaupetit commented 3 years ago

I can confirm that it's more or less related to #430...