Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before, if I installed this package with pip then I couldn't actually use mypy with it, because mypy wouldn't find the type annotations because this wasn't structured to follow PEP561. This follows the advice of https://mypy.readthedocs.io/en/latest/installed_packages.html#creating-pep-561-compatible-packages I must admit that I didn't add any tests for this. I don't think we currently have tests that would catch typing errors? I don't understand how the mypy extension for pytest works, I've only used mypy by itself. It looks to me like we don't have any typing hints in the test files, so mypy isn't even going to analyze any of those functions? I did try installing this version locally in editable mode, and then tested it in my separate project (https://github.com/staticjinja/staticjinja). Before, mypy couldn't find the type annotations for docopt, but after this change it could. So that's one test, but really there should be other tests actually in here to make sure that 1. The type hints are actually correct (probably via the tests/ files) 2. We are actually testing against the packaged version, not the source version, so that we are catching any packaging errors. This sort of test would have caught this problem I think. At the very least, I don't _think_ this should break anyone? People still will import docopt in the exact same way. Maybe there's some small under-the-hood change that happens because of this restructuring that will break someone?
- Loading branch information