diff --git a/setup.py b/setup.py index 73c0546..52c8a13 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,10 @@ from distutils.core import setup from Cython.Build import cythonize -# todo add "embedsignature.format" directive, set it to python when new Cython release comes out setup( name='tenforce', - ext_modules=cythonize(["tenforce/enforcer.pyx"]) + ext_modules=cythonize(["tenforce/enforcer.pyx"]), + package_data={ + "tenforce": ["py.typed", "enforcer.pyi"] + } ) diff --git a/tenforce/enforcer.pyi b/tenforce/enforcer.pyi index 02d7c3c..4de1059 100644 --- a/tenforce/enforcer.pyi +++ b/tenforce/enforcer.pyi @@ -1,7 +1,8 @@ -def check(obj: object, auto_cast: bool = False) -> None: +def check(obj: object, auto_cast: bool) -> None: """ Checks the class variables of an object & enforces its type hints :param obj: Instance of a class :param auto_cast: Optional, automatically cast things like :return: None - """ \ No newline at end of file + """ + ... \ No newline at end of file diff --git a/tenforce/enforcer.pyx b/tenforce/enforcer.pyx index 875cb5d..7c3c3ba 100644 --- a/tenforce/enforcer.pyx +++ b/tenforce/enforcer.pyx @@ -139,7 +139,7 @@ cpdef ParsedMember _parse_member(str class_name, str member_name, type annotatio return parsed_member -cpdef check(object obj: object, bint auto_cast: bool = False): +cpdef check(object obj, bint auto_cast = False): """ Checks the class variables of an object & enforces its type hints :param obj: Instance of a class