diff --git a/quicktex/py.typed b/quicktex/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index e91d9af..bdf196b 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import os import sys +import glob import subprocess from setuptools import setup, Extension, find_packages @@ -99,6 +100,9 @@ class CMakeBuild(build_ext): ) +# Find stub files +stubs = [path.replace('quicktex/', '') for path in glob.glob('quicktex/**/*.pyi', recursive=True)] + # The information here can also be placed in setup.cfg - better separation of # logic and declaration, and simpler if you include description/version in a file. setup( @@ -113,6 +117,8 @@ setup( cmdclass={"build_ext": CMakeBuild}, packages=find_packages('.'), package_dir={'': '.'}, + package_data={'': ['py.typed'] + stubs}, + include_package_data=True, install_requires=["Pillow", "click"], extras_require={ "tests": ["nose", "parameterized"], diff --git a/tools/stubgen.py b/tools/stubgen.py index 2964852..32504ec 100644 --- a/tools/stubgen.py +++ b/tools/stubgen.py @@ -40,7 +40,7 @@ if __name__ == "__main__": for mod in modules: new_mod = mod.replace(prefix, '') - contents.replace(mod, new_mod) + contents = contents.replace(mod, new_mod) # write out to the new location py_module = ext_module.replace(prefix, '')