gnebbia / kb

A minimalist command line knowledge base manager
GNU General Public License v3.0
3.15k stars 101 forks source link

kb/printer/style.py #109

Closed GasparVardanyan closed 11 months ago

GasparVardanyan commented 1 year ago

What does this implement/fix? Explain your changes.

... Maybe python-colored is updated and changed the parameter name from 'underlined' to 'underline' Does this close any currently open issues?

...

Any relevant logs, error output, etc?

Traceback (most recent call last):
  File "/home/gaspar/testenv/bin/kb", line 5, in <module>
    from kb.main import main
  File "/home/gaspar/testenv/lib/python3.11/site-packages/kb/main.py", line 20, in <module>
    from kb.commands.search import search
  File "/home/gaspar/testenv/lib/python3.11/site-packages/kb/commands/search.py", line 17, in <module>
    import kb.printer.search as printer
  File "/home/gaspar/testenv/lib/python3.11/site-packages/kb/printer/search.py", line 15, in <module>
    from kb.printer.style import ALT_BGROUND, BOLD, UND, RESET
  File "/home/gaspar/testenv/lib/python3.11/site-packages/kb/printer/style.py", line 20, in <module>
    UND = styler.set_style('underlined')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gaspar/testenv/lib/python3.11/site-packages/kb/styler.py", line 59, in set_style
    return colored.attr(style)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/gaspar/testenv/lib/python3.11/site-packages/colored/colored.py", line 263, in attr
    return Colored(name).attribute()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gaspar/testenv/lib/python3.11/site-packages/colored/colored.py", line 64, in attribute
    self._utils.is_style_exist(self._name)
  File "/home/gaspar/testenv/lib/python3.11/site-packages/colored/utilities.py", line 53, in is_style_exist
    raise InvalidStyle(f'{InvalidStyle.__name__}: {name}')
colored.exceptions.InvalidStyle: InvalidStyle: underlined

Any other comments?

...

Where has this been tested?

Operating System: ArchLinux

Platform: x64

Target Platform: what is this?

lewis262626 commented 1 year ago

The requirements.txt file should be using semver to pin dependencies tbh. It should stop this from happening in the future.

gnebbia commented 11 months ago

thanks for the PR and sorry for the delay! Yes I will switch to semantic versioning for the next release