alanjds / drf-nested-routers

Nested Routers for Django Rest Framework
https://pypi.org/project/drf-nested-routers/
Apache License 2.0
1.66k stars 157 forks source link

Mark package as including typehints #343

Closed intgr closed 4 months ago

intgr commented 4 months ago

PEP 561 requires typehinted projects to include a py.typed file, for typecheckers to recognize the hints.

https://peps.python.org/pep-0561/#packaging-type-information

alanjds commented 4 months ago

This py.typed is new for me. Reading the docs, I felt that marking the stubs as "partial" can be beneficial. What do you think? https://peps.python.org/pep-0561/#partial-stub-packages

Many stub packages will only have part of the type interface for libraries completed, especially initially. For the benefit of type checking and code editors, packages can be “partial”.

If a stub package distribution is partial it MUST include partial\n in a py.typed file.

intgr commented 4 months ago

"Partial" is not relevant for us. I covered all modules in the rest_framework_nested package. Mypy's disallow_incomplete_defs and disallow_untyped_defs should ensure that untyped definitions can't be added.

Also I think it's for stub packages only (those that provide only .pyi files).

alanjds commented 4 months ago

FYI: Just released v0.94.1 on PyPI with the py.typed mark