]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Define the package_data info in the setup.cfg files
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 26 Jun 2021 02:37:35 +0000 (03:37 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 26 Jun 2021 22:39:31 +0000 (23:39 +0100)
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.

psycopg3/setup.cfg
psycopg3/setup.py
psycopg3_c/setup.cfg
psycopg3_c/setup.py

index 1bc23b383c9d0a11f8efc8a807756979f811265e..3949a2cb417db4c2f2e53941810d5b5cda5dff8a 100644 (file)
@@ -34,4 +34,4 @@ install_requires =
     typing_extensions; python_version < "3.8"
 
 [options.package_data]
-psycopg3_c = py.typed
+psycopg3 = py.typed
index 06830580586c7161862f6d7d370eb52a625d5043..712c14e108ab16ee15c196a7c847e3b27c82f9e4 100644 (file)
@@ -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"]},
 )
index 273d9e29f2fdd7c258ee7d9fa92c2701408561cf..a4b11dc8f02937716c50b7b3a76c30fafdde9b26 100644 (file)
@@ -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
index 23f5769d617cafc9bccd381332db5e1b3154213a..d04363aea999b0bcc18d55458bd9b9b07446a845 100644 (file)
@@ -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"],
-    },
 )