#49 added annotations. But mypy won't go looking for them unless we mark the module as having annotations: ``` $ pip show canonicaljson | \grep ^Version Version: 1.6.1 $ grep canonicaljson mypy.ini $ mypy synapse/__init__.py:67: error: Skipping analyzing "canonicaljson": module is installed, but missing library stubs or py.typed marker [import] synapse/__init__.py:67: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports ``` We need a py.typed marker file, but there's no way to do that for single-file modules. https://peps.python.org/pep-0561/#packaging-type-information writes: > This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages. > > The single-file module should be refactored into a package and indicate that the package supports typing [by including a py.typed marker file].
Activity
DMRobertson commentedon Sep 22, 2022
Fix here is to make this a proper package
canonicaljson.py->__init__.pycanonicaljsonand move__init__.pyinto itpy.typedfile in thecanonicaljsondirectory and ensure it's distributed once this is packaged upEdit: for bonus points, update Synapse to
Properly package the canonicaljson module (#52)