From: Daniele Varrazzo Date: Sat, 26 Jun 2021 02:37:35 +0000 (+0100) Subject: Define the package_data info in the setup.cfg files X-Git-Tag: 3.0.dev0~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5cc19294ad787b56fba44d7ae1faa4f2a0044305;p=thirdparty%2Fpsycopg.git Define the package_data info in the setup.cfg files 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. --- diff --git a/psycopg3/setup.cfg b/psycopg3/setup.cfg index 1bc23b383..3949a2cb4 100644 --- a/psycopg3/setup.cfg +++ b/psycopg3/setup.cfg @@ -34,4 +34,4 @@ install_requires = typing_extensions; python_version < "3.8" [options.package_data] -psycopg3_c = py.typed +psycopg3 = py.typed diff --git a/psycopg3/setup.py b/psycopg3/setup.py index 068305805..712c14e10 100644 --- a/psycopg3/setup.py +++ b/psycopg3/setup.py @@ -49,6 +49,4 @@ extras_require = { setup( version=version, extras_require=extras_require, - # TODO: doesn't work in setup.cfg - package_data={"psycopg3": ["py.typed"]}, ) diff --git a/psycopg3_c/setup.cfg b/psycopg3_c/setup.cfg index 273d9e29f..a4b11dc8f 100644 --- a/psycopg3_c/setup.cfg +++ b/psycopg3_c/setup.cfg @@ -31,3 +31,14 @@ python_requires = >= 3.6 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 diff --git a/psycopg3_c/setup.py b/psycopg3_c/setup.py index 23f5769d6..d04363aea 100644 --- a/psycopg3_c/setup.py +++ b/psycopg3_c/setup.py @@ -94,12 +94,4 @@ setup( 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"], - }, )