setup.py: reduce size of sdist.
authorJulian Smith <[email protected]>
Thu, 12 Jan 2023 11:45:42 +0000 (11:45 +0000)
committerJulian Smith <[email protected]>
Fri, 13 Jan 2023 14:33:56 +0000 (14:33 +0000)
We remove some large test directories in thirdparty/. Reduces sdist from 127M
to 79M.

setup.py

index 9d68986883ec6d93a3ba1bd69cade8a445016225..ab6aa95ff688441f769e304934eba335ebcb283d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -207,6 +207,23 @@ def sdist():
 
     paths = pipcl.git_items( root_dir(), submodules=True)
 
+    # Strip out some large test directories.
+    i = 0
+    while i < len( paths):
+        path = paths[i]
+        remove = False
+        if (0
+                or path.startswith( 'thirdparty/harfbuzz/test/')
+                or path.startswith( 'thirdparty/tesseract/test/')
+                or path.startswith( 'thirdparty/extract/test/')
+                ):
+            remove = True
+        if remove:
+            #log( f'Excluding: {path}')
+            del paths[i]
+        else:
+            i += 1
+
     # Build C++ files and SWIG C code for inclusion in sdist, so that it can be
     # used on systems without clang-python or SWIG.
     #