Skip to content

Run mypy on full library #848

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

Open
drvinceknight opened this issue Feb 2, 2017 · 4 comments
Open

Run mypy on full library #848

drvinceknight opened this issue Feb 2, 2017 · 4 comments

Comments

@drvinceknight
Copy link
Member

@marcharper found a bug in mypy but this has now been patched: python/mypy#2786

This bug currently stops us from type checking the whole library (as some modules don't play nice) so type_tests.sh type checks each relevant module.

When mypy next does a release we should update type_tests.sh (or get rid of it and simply run the required command in travis.yml?).

We should also add the corresponding mypy command to the docs.

@drvinceknight
Copy link
Member Author

@marcharper I think the latest release of mypy might have the fix but I'm not sure, I've tried running things locally:

$  mypy --ignore-missing-imports --follow-imports skip -m axelrod

Runs fine without errors but it doesn't report failures (I've tested this by breaking type hints and they're failing silently). If you could take another look to see if it's just me that'd be great.

We've missed at least 1 module in PRs (the random_ module, PR here: #983) to be added to run_mypy so would be nice to cover everything if possible so that we don't need that.

@marcharper
Copy link
Member

marcharper commented Apr 20, 2017

I confirm no errors running the latest mypy with our master or the mypy_random branch.

Errors are reported with mypy --ignore-missing-imports -m axelrod

@drvinceknight
Copy link
Member Author

Errors are reported with mypy --ignore-missing-imports -m axelrod

Ah, but errors are reported there on master as is. So there's no command we can currently run that will run mypy on all the files that have been typehinted? (For example that command reports errors on meta.py which we have not typehinted yet).

There's no way (yet) to replace our run_mypy.py script? We still need to make sure we manually add everything to it is that right?

@marcharper
Copy link
Member

I think so.

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

No branches or pull requests

2 participants