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

Default Installation not working due to typer mismatch #96

Closed
Rugz007 opened this issue Dec 4, 2024 · 3 comments · Fixed by #98
Closed

Default Installation not working due to typer mismatch #96

Rugz007 opened this issue Dec 4, 2024 · 3 comments · Fixed by #98

Comments

@Rugz007
Copy link

Rugz007 commented Dec 4, 2024

I tried installing venvstacks using pipx but got this error on macOS

Seems like typer just had a breaking change with callback names: fastapi/typer#1052

  File "/Users/rugvedsomwanshi/.local/bin/venvstacks", line 5, in <module>
    from venvstacks.cli import main
  File "/Users/rugvedsomwanshi/.local/lib/python3.11/site-packages/venvstacks/cli.py", line 39, in <module>
    @_cli.callback(name=_get_usage_name())
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Typer.callback() got an unexpected keyword argument 'name'```
@ncoghlan
Copy link
Collaborator

ncoghlan commented Dec 5, 2024

The downside of pinning CI dependencies :(

Thanks for the heads up and interim fix - I'll see if I can avoid needing the latter by actually handling the new behaviour.

ncoghlan added a commit that referenced this issue Dec 5, 2024
Also prepares for 0.2.1 bugfix release.

Closes #96
ncoghlan added a commit that referenced this issue Dec 5, 2024
Also prepares for 0.2.1 bugfix release.

Closes #96
@ncoghlan
Copy link
Collaborator

ncoghlan commented Dec 5, 2024

#98 should actually fix the incompatibility (without breaking 0.12.4 compatibility for existing installations).

I'm not sure how I ended up setting the name via the callback instead of when calling typing.Typer itself - presumably just a misreading of the docs when migrating from one top level command to multiple subcommands, or something along those lines (and then I stopped looking for a better way to set it, since what I had appeared to be working).

@ncoghlan
Copy link
Collaborator

ncoghlan commented Dec 5, 2024

0.2.1 has been published with this fix:

$ pipx reinstall venvstacks
uninstalled venvstacks! ✨ 🌟 ✨
  installed package venvstacks 0.2.1, installed using Python 3.12.6
  These apps are now globally available
    - venvstacks
done! ✨ 🌟 ✨
$ pipx runpip venvstacks list | grep typer-slim
typer-slim        0.15.1
$ venvstacks --help

 Usage: venvstacks [OPTIONS] COMMAND [ARGS]...

 Lock, build, and publish Python virtual environment stacks.

╭─ Options ───────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                     │
╰─────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────╮
│ build          Build (/lock/publish) Python virtual environment stacks.         │
│ lock           Lock layer requirements for Python virtual environment stacks.   │
│ publish        Publish layer archives for Python virtual environment stacks.    │
│ local-export   Export layer environments for Python virtual environment stacks. │
╰─────────────────────────────────────────────────────────────────────────────────╯

(I had also checked it still worked after a pipx upgrade-all that updated to venvstacks 0.2.1, but left typer-slim 0.12.5 installed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants