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

🐛 Upgrading from typer<0.12.0 to typer==0.12.0 breaks the install by partially removing the package/module files #790

Closed
7 tasks done
tiangolo opened this issue Apr 4, 2024 Discussed in #784 · 4 comments
Labels
bug Something isn't working

Comments

@tiangolo
Copy link
Member

tiangolo commented Apr 4, 2024

This is reproduced and being worked on right now. 🤓

Discussed in #784

Originally posted by brianmedigate March 31, 2024

First Check

  • I added a very descriptive title here.
  • I used the GitHub search to find a similar question 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

$ python3.8 -m virtualenv venv
$ . venv/bin/activate
$ pip install typer==0.9.0
$ pip install typer==0.12.0
$ ll venv/lib/python3.8/site-packages/typer/
total 36
drwxrwxr-x  3 brianm brianm 4096 Mar 31 17:52 ./
drwxrwxr-x 28 brianm brianm 4096 Mar 31 17:52 ../
-rw-rw-r--  1 brianm brianm 9149 Mar 31 17:52 cli.py
-rw-rw-r--  1 brianm brianm 6689 Mar 31 17:52 _completion_classes.py
-rw-rw-r--  1 brianm brianm   30 Mar 31 17:52 __main__.py
drwxrwxr-x  2 brianm brianm 4096 Mar 31 17:52 __pycache__/

Description

After upgrading typer 0.9.0 to 0.12.0 in an existing virtual environment, the typer directory in site packages doesn't contain the expected code of typer. It looks like it only contains typer-cli or something like that. I'm guessing it has something to do with the recent packaging changes in #780.

Operating System

Linux

Operating System Details

Ubuntu 22.04.3

Typer Version

0.12.0

Python Version

3.8.18

Additional Context

No response

@tiangolo tiangolo added the bug Something isn't working label Apr 4, 2024
@lone17
Copy link

lone17 commented Apr 4, 2024

Minor typo in the title: should be typer<0.12.0 😄

@bckohan
Copy link
Contributor

bckohan commented Apr 4, 2024

Yes - I ran into this problem here: django-commons/django-typer#47

I think its a bug in pip. I would expect this to work.

In my case, since my downstream users did not need the cli, changing the dependency from typer to typer-slim allowed the updates to work. I tested this using normal pip upgrades and poetry updates

@tiangolo tiangolo changed the title 🐛 Upgrading from typer>0.12.0 to typer==0.12.0 breaks the install by partially removing the package/module files 🐛 Upgrading from typer<0.12.0 to typer==0.12.0 breaks the install by partially removing the package/module files Apr 4, 2024
@tiangolo
Copy link
Member Author

tiangolo commented Apr 5, 2024

This was fixed in #791, released in Typer 0.12.1 🚀 🎉

@tiangolo tiangolo closed this as completed Apr 5, 2024
@washeck
Copy link

washeck commented Apr 5, 2024

Is this really solved?

$ pip3 list | grep typer
typer                    0.12.1
$ python3
Python 3.11.6 (main, Nov 30 2023, 18:14:11) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import typer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'typer'

I have typer installed via pipenv as a dependency of safety.

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

No branches or pull requests

4 participants