yfsn666 commented on code in PR #12091:
URL: https://github.com/apache/inlong/pull/12091#discussion_r2882666248


##########
inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python/pyproject.toml:
##########
@@ -0,0 +1,54 @@
+[build-system]
+requires = [
+  "scikit-build-core", "pybind11",
+]
+build-backend = "scikit_build_core.build"
+
+[project]
+name = "inlong-dataproxy-sdk"
+version = "2.3.0"
+description = "Python bindings for Apache InLong DataProxy SDK"
+readme = "README.md"
+requires-python = ">=3.8"
+license = { text = "Apache-2.0" }
+authors = [
+  { name = "Apache InLong" },
+]
+classifiers = [
+  "License :: OSI Approved :: Apache Software License",
+  "Programming Language :: Python :: 3",
+  "Programming Language :: C++",
+  "Operating System :: POSIX :: Linux",
+]
+
+[project.urls]
+Homepage = "https://github.com/apache/inlong";
+Source = 
"https://github.com/apache/inlong/tree/master/inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-python";
+
+[tool.scikit-build]
+# Do NOT run CMake when building sdist.
+sdist.cmake = false
+
+# Make sdist minimal via a strict allowlist.
+# Note: `sdist.include` is additive to the default set and does NOT override 
`sdist.exclude`.
+# If you want a true allowlist, keep everything in ONE ignore list using `**` 
+ `!` rules.
+# Patterns follow .gitignore syntax (order matters; later rules override 
earlier ones).
+
+sdist.exclude = [
+  "**/*",
+
+  # --- Python binding sources/build config ---
+  "!/pyproject.toml",
+  "!/CMakeLists.txt",
+  "!/inlong_dataproxy.cpp",
+  "!/inlong_dataproxy.pyi",
+  "!/README.md",
+
+  # Headers referenced by current CMake include_directories
+  "!/dataproxy-sdk-cpp/src/core/*.h",
+
+  # Static libraries used by linking
+  "!/dataproxy-sdk-cpp/release/lib/*.a",
+  "!/dataproxy-sdk-cpp/third_party/lib/*.a",
+  "!/dataproxy-sdk-cpp/third_party/lib64/*.a",
+]

Review Comment:
   The `**/*` + `!` negation approach does not work for files inside 
subdirectories.
   Since `**/*` excludes the `dataproxy-sdk-cpp/` directory itself, all 
subsequent negation rules like `!/dataproxy-sdk-cpp/release/lib/*.a` are 
silently ignored. As a result, the generated sdist contains none of the .a 
static libraries or .h header files, which causes `pip wheel dist/*.tar.gz` to 
fail with:
   ```shell
   ninja: error: '.../dataproxy_sdk.a', needed by 'inlong_dataproxy...so', 
missing and no known rule to make it
   ```
   
   <img width="3984" height="2542" alt="Image" 
src="https://github.com/user-attachments/assets/00c4fdfe-e2dd-4ec9-8dd9-897fd5b7b457";
 />
   
   ```suggestion
   # Exclude unneeded files from dataproxy-sdk-cpp (sources, build 
intermediates, etc.)
   sdist.exclude = [
     "dataproxy-sdk-cpp/**",
     "demo/**",
     "build.sh",
     "requirements.txt",
   ]
   
   # Force-include headers and static libraries required for wheel build
   sdist.include = [
     "dataproxy-sdk-cpp/src/core/*.h",
     "dataproxy-sdk-cpp/release/lib/*.a",
     "dataproxy-sdk-cpp/third_party/lib/*.a",
     "dataproxy-sdk-cpp/third_party/lib64/*.a",
   ]
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to