lemon24 / reader

A Python feed reader library.
https://reader.readthedocs.io
BSD 3-Clause "New" or "Revised" License
438 stars 36 forks source link

Actually allow users to use mypy with reader #280

Closed lemon24 closed 2 years ago

lemon24 commented 2 years ago
$ mypy --strict -c 'from reader import make_reader'
<string>:1: error: Skipping analyzing "reader": module is installed, but missing library stubs or py.typed marker
<string>:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
$ touch src/reader/py.typed                        
$ mypy --strict -c 'from reader import make_reader'
<string>:1: error: Module "reader" does not explicitly export attribute "make_reader"; implicit reexport disabled
Found 1 error in 1 file (checked 1 source file)
$ sed -i.old 's/make_reader/make_reader as make_reader/' src/reader/__init__.py 
$ mypy --strict -c 'from reader import make_reader'                            
Success: no issues found in 1 source file
lemon24 commented 2 years ago

Heh, this exists: https://typing.readthedocs.io/en/latest/source/libraries.html