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

Typer AttributeError in latest release #70

Closed
ewels opened this issue May 17, 2022 · 3 comments
Closed

Typer AttributeError in latest release #70

ewels opened this issue May 17, 2022 · 3 comments
Labels
bug Something isn't working high priority

Comments

@ewels
Copy link
Owner

ewels commented May 17, 2022

Originally posted by @taranlu-houzz in #59 (comment)


Hey @ewels, I just updated to the latest release of rich-click, but I am now getting this error (the first part of the help was printed before hitting this error):

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/---/cli.py", line 267, in run_app
    APP()
  File "/---/lib/python3.10/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/---/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/---/lib/python3.10/site-packages/rich_click/rich_group.py", line 21, in main
    return super().main(*args, standalone_mode=False, **kwargs)
  File "/---/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/---/lib/python3.10/site-packages/click/core.py", line 1655, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/---/lib/python3.10/site-packages/click/core.py", line 920, in make_context
    self.parse_args(ctx, args)
  File "/---/lib/python3.10/site-packages/click/core.py", line 1378, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/---/lib/python3.10/site-packages/click/core.py", line 2360, in handle_parse_result
    value = self.process_value(ctx, value)
  File "/---/lib/python3.10/site-packages/click/core.py", line 2322, in process_value
    value = self.callback(ctx, self, value)
  File "/---/lib/python3.10/site-packages/click/core.py", line 1273, in show_help
    echo(ctx.get_help(), color=ctx.color)
  File "/---/lib/python3.10/site-packages/click/core.py", line 699, in get_help
    return self.command.get_help(self)
  File "/---/lib/python3.10/site-packages/click/core.py", line 1298, in get_help
    self.format_help(ctx, formatter)
  File "/---/lib/python3.10/site-packages/rich_click/rich_command.py", line 32, in format_help
    rich_format_help(self, ctx, formatter)
  File "/---/lib/python3.10/site-packages/rich_click/rich_click.py", line 459, in rich_format_help
    _get_parameter_help(param, ctx),
  File "/---/lib/python3.10/site-packages/rich_click/rich_click.py", line 245, in _get_parameter_help
    if param.allow_from_autoenv and ctx.auto_envvar_prefix is not None and param.name is not None:
AttributeError: 'TyperArgument' object has no attribute 'allow_from_autoenv'
@ewels
Copy link
Owner Author

ewels commented May 17, 2022

Hi @taranlu-houzz,

This should now be fixed on main in bc674e8 - it would be great if you could give it a test and confirm that it's ok now.. 👍🏻

I'll push out a release with this ASAP.

Phil

ewels added a commit that referenced this issue May 17, 2022
@ewels
Copy link
Owner Author

ewels commented May 17, 2022

Just released v1.4 with this fix. Hopefully should work for you now 👍🏻

@taranlu-houzz
Copy link
Contributor

@ewels I can confirm that this fixed the issue that was triggering the above error (still hitting the original problem from my other issue though).

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

No branches or pull requests

2 participants