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

click.utils has no attribute _expand_args (click version 7.1.2, typer version 0.6.1) #427

Closed
7 tasks done
falcomomo opened this issue Jul 14, 2022 · 2 comments · Fixed by #760
Closed
7 tasks done
Labels
investigate question Question or problem

Comments

@falcomomo
Copy link

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Typer documentation, with the integrated search.
  • I already searched in Google "How to X in Typer" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to Typer but to Click.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

import typer

def main(name: str):
    typer.echo(f'Hello {name}')


if __name__ == '__main__':
    typer.run(main)

Description

  • run python typer_script.py
  • On the typer.run() call: AttributeError: 'click.utils' has no attribute '_expand_args'

I was on typer version 0.6.1 and click version 7.1.2 (which meets the requirements for typer 0.6.1)

I updated to click version 8.0.4 and it's ok now.

In typer.core:190 you call click.utils._expand_args, but this was only added in click major version 8 from what I can tell.

Operating System

Windows

Operating System Details

No response

Typer Version

0.6.1

Python Version

3.6.13

Additional Context

None

@falcomomo falcomomo added the question Question or problem label Jul 14, 2022
@parvva
Copy link

parvva commented Aug 26, 2022

Is there any update on this?

@texasfight
Copy link

In the meantime, you can just add something along the lines of
click>=8.0.0,<9.0.0
to your requirements.txt, setup.py, etc. depending on your use-case.

I opened a PR and hopefully @tiangolo can see this at some point even though it seems to only be affecting a few of us.

I wouldn't care that much except for the fact that CLIs are generally going to be installed outside of a virtualenv and other libraries may have previously installed a lower version (like what I ran into).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate question Question or problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants