It wasn't working... because there was a typo.
Also fix inclusion of pxd files in the psycopg3_c sdist package: finding
them recursively doesn't work because the subdirectories are not
packages (and making them so, adding __init__.py files, breaks
everything) so specify all the paths where they are to be found.
typing_extensions; python_version < "3.8"
[options.package_data]
-psycopg3_c = py.typed
+psycopg3 = py.typed
setup(
version=version,
extras_require=extras_require,
- # TODO: doesn't work in setup.cfg
- package_data={"psycopg3": ["py.typed"]},
)
setup_requires = Cython >= 3.0a5
packages = find:
zip_safe = False
+
+[options.package_data]
+# NOTE: do not include .pyx files: they shouldn't be in the sdist
+# package, so that build is only performed from the .c files (which are
+# distributed instead).
+psycopg3_c =
+ py.typed
+ *.pyi
+ *.pxd
+ _psycopg3/*.pxd
+ pq/*.pxd
version=version,
ext_modules=[pgext, pqext],
cmdclass={"build_ext": psycopg3_build_ext},
- # For some reason pacakge_data doesn't work in setup.cfg
- package_data={
- "psycopg3_c": ["py.typed"],
- # NOTE: do not include .pyx files: they shoudn't be in the sdist
- # package, so that build is only performed from the .c files (which are
- # distributed instead).
- "": ["*.pxd", "*.pyi"],
- },
)