carpedm20 / emoji

emoji terminal output for Python
Other
1.9k stars 278 forks source link

Mypy giving error when using emojize #250

Closed cap-jmk closed 1 year ago

cap-jmk commented 1 year ago

When using emojize inside a typed function, I recieve the following error:

error: Call to untyped function "emojize" in typed context  [no-untyped-call]

Do you know how to handle that?

cvzi commented 1 year ago

Are you using the latest version of the package? There was a bug in earlier version that was fixed in #239

cap-jmk commented 1 year ago

Yes, I am using v2.2.0. We could try using lia to fix it? https://codeberg.org/cap_jmk/lia

pip install spawn-lia
lia heal emoji

May the force be with you ;)

cvzi commented 1 year ago

I am not familiar with lia what does it do?

cvzi commented 1 year ago

I found the problem, the .tar.gz package doesn't ship the type information at the moment, i.e. the *.pyi files aren't included.

This will be fixed by #248

If I install from that pull request via pip install --force-reinstall git+https://github.com/cvzi/emoji@wheel then mypy is happy.

cap-jmk commented 1 year ago

I am not familiar with lia what does it do?

It helps with CI. I am making frequently a lot of mistakes recently, so I code a package that helps mitigating them. It includes 1.) Linting 2.) Automated formatting of various sorts 3.) Typechecking 4.) Git checking

And thank you for the fix :)

cvzi commented 1 year ago

Thanks, I'll check it out 🙂 Looks interesting