Skip to content

Arcade's type hinting is not available to modules that import arcade #781

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

Closed
SirGnip opened this issue Nov 3, 2020 · 3 comments
Closed

Comments

@SirGnip
Copy link
Contributor

SirGnip commented Nov 3, 2020

Running mypy on a project that uses arcade doesn't seem to be able to make use of the 2222type hints in arcade:

(repro done on Windows 10 with GitBash)

$ python -m venv venv
$ source venv/Scripts/activate
$ pip install arcade==2.4.3

# create mygame.py
import arcade
print(arcade.Sprite())

$ python mygame.py
<arcade.sprite.Sprite object at 0x000001C495549470>

$ pip install mypy
$ mypy mygame.py
mygame.py:1: error: Skipping analyzing 'arcade': found module but no type hints or library stubs
mygame.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

If you run mypy on the arcade repo itself, it does the type hinting as expected. But, if you run mypy on a project that imports arcade, you get failures. Arcade's type hinting was originally exposed to other packages via #533. I'm guessing tthe regression was introduced because the py.typed file was dropped during this commit: f0ff238#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7.

@Cleptomania
Copy link
Member

Planning to fix this as part of #780. Will update with the specific commit when it's done.

@Cleptomania
Copy link
Member

This is fixed in c82d868

@Cleptomania
Copy link
Member

This is fixed as of the 2.5 release by #780

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

No branches or pull requests

2 participants