Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli is throwing "unexpected keyword argument 'rich_markup_mode'" #33

Closed
jakane opened this issue Aug 30, 2023 · 2 comments · Fixed by #34
Closed

cli is throwing "unexpected keyword argument 'rich_markup_mode'" #33

jakane opened this issue Aug 30, 2023 · 2 comments · Fixed by #34
Labels
bug Something isn't working

Comments

@jakane
Copy link

jakane commented Aug 30, 2023

Describe the Bug

It appears that there have been changes between what you expect and what click-help-colors provides.

│   121  
│   122 class CustomHelpColoursCommand(HelpColorsCommand):
│   123 │   def __init__(self, *args, **kwargs) -> None:
│ ❱ 124 │   │   super().__init__(*args, **kwargs)
│   125 │   │   self.help_headers_color = "blue"
│   126 │   │   self.help_options_color = "yellow"
│   127
│
│ ╭─────────────────────────────────────────── locals 
│ │   args = ()
│ │ kwargs = {
│ │          │   'name': 'qrz',
│ │          │   'context_settings': {'help_option_names': ['-h', '--help']},
│ │          │   'callback': <function qrz at 0x7f3f19f96ca0>,
│ │          │   'params': [
│ │          │   │   <TyperOption username>,
│ │          │   │   <TyperOption password>,
│ │          │   │   <TyperArgument call> 
│ │          │   ],
│ │          │   'help': 'Use QRZ to look up a callsign\n\nRequires a QRZ account and an XML
│ │          Logbook Data or'+25,
│ │          │   'epilog': 'Copyright 2021-2023 by classabbyamp, 0x5c. Released under the BSD
│ │          3-Clause Licen'+2,
│ │          │   'short_help': None,
│ │          │   'options_metavar': '[OPTIONS]',
│ │          │   'add_help_option': True,
│ │          │   'no_args_is_help': False,
│ │          │   ... +4
│ │          }
│ │   self = <repr-error "'CustomHelpColoursCommand' object has no attribute 'name'">
│ ╰
│
│ /home/jkane/radio/callsignlookuptools/.venv/lib/python3.11/site-packages/click_help_colors/core.py:93 in __init__ 
│
│ /home/jkane/radio/callsignlookuptools/.venv/lib/python3.11/site-packages/click_help_colors/core.py:57 in __init__                                                                                │
╰
TypeError: Command.__init__() got an unexpected keyword argument 'rich_markup_mode'

Steps To Reproduce

I performed a fresh install, in a virtual environment:

$ git clone https://github.com/miaowware/callsignlookuptools.git
Cloning into 'callsignlookuptools'...
remote: Enumerating objects: 346, done.
remote: Counting objects: 100% (136/136), done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 346 (delta 66), reused 74 (delta 40), pack-reused 210
Receiving objects: 100% (346/346), 157.03 KiB | 1.52 MiB/s, done.
Resolving deltas: 100% (175/175), done.

$ cd callsignlookuptools/

$ pipenv --python=3.11 install
Creating a virtualenv for this project...
Pipfile: /home/jkane/radio/callsignlookuptools/Pipfile
Using /home/jkane/.pyenv/versions/3.11.3/bin/python3 (3.11.3) to create virtualenv...
⠹ Creating virtual environment...created virtual environment CPython3.11.3.final.0-64 in 128ms
  creator CPython3Posix(dest=/home/jkane/radio/callsignlookuptools/.venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/jkane/.local/share/virtualenv)
    added seed packages: pip==22.0.4, setuptools==60.10.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment! 
Virtualenv location: /home/jkane/radio/callsignlookuptools/.venv
requirements.txt found in /home/jkane/radio/callsignlookuptools instead of Pipfile! Converting...
✔ Success! 
Warning: Your Pipfile now contains pinned versions, if your requirements.txt did. 
We recommend updating your Pipfile to specify the "*" version, instead.
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success! 
Warning: /home/jkane/.local/lib/python3.10/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.
  set_closure_cell(cell, cls)
Updated Pipfile.lock (c30e52)!
Installing dependencies from Pipfile.lock (c30e52)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 27/27 — 00:00:05
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

Expected behavior

Expected to see help text for cli command.

Environment

$ pipenv run python --version
Loading .env environment variables...
Python 3.11.3

$ pipenv run pip freeze
Loading .env environment variables...
aiohttp==3.8.5
aiosignal==1.3.1
annotated-types==0.5.0
async-timeout==4.0.3
attrs==23.1.0
certifi==2023.7.22
charset-normalizer==3.2.0
click==8.1.7
click-help-colors==0.9.2
colorama==0.4.6
frozenlist==1.4.0
gridtools==1.0.0.post1
idna==3.4
lxml==4.9.3
markdown-it-py==3.0.0
mdurl==0.1.2
multidict==6.0.4
pydantic==2.3.0
pydantic_core==2.6.3
Pygments==2.16.1
requests==2.31.0
rich==13.5.2
shellingham==1.5.3
typer==0.9.0
typing_extensions==4.7.1
urllib3==2.0.4
yarl==1.9.2

Note: There is no .env file

@jakane jakane added the bug Something isn't working label Aug 30, 2023
classabbyamp added a commit that referenced this issue Aug 30, 2023
click-help-colors is no longer compatible with typer and the colours
look fine as-is, so drop it.
fastapi/typer#47 (comment)

fixes #33
@classabbyamp classabbyamp mentioned this issue Aug 30, 2023
8 tasks
classabbyamp added a commit that referenced this issue Aug 30, 2023
click-help-colors is no longer compatible with typer and the colours
look fine as-is, so drop it.
fastapi/typer#47 (comment)

fixes #33
classabbyamp added a commit that referenced this issue Aug 31, 2023
click-help-colors is no longer compatible with typer and the colours
look fine as-is, so drop it.
fastapi/typer#47 (comment)

fixes #33
@jakane
Copy link
Author

jakane commented Aug 31, 2023

awesome ... fixed the problem ... thanks for the rapid response, I don't use typer so I did not check that path

@classabbyamp
Copy link
Member

no problem! I had to figure out what the heck I was doing back then, then found an issue I had commented in the code about how colours in the help text were done. turns out it's no longer compatible with typer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants