Sxnan commented on code in PR #567:
URL: https://github.com/apache/flink-agents/pull/567#discussion_r2945021661


##########
python/_build_backend/backend.py:
##########
@@ -0,0 +1,183 @@
+################################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+#################################################################################
+
+"""Custom PEP 517 build backend that downloads JARs from Maven Central.
+
+Wraps ``setuptools.build_meta`` and overrides ``build_wheel()`` to download
+JAR files before the standard setuptools build runs.  This ensures that
+``pip install flink-agents`` (from sdist) produces a wheel that already

Review Comment:
   1. **Local Development Flow:** When using `./tools/build.sh` on a local 
branch (including `-SNAPSHOT` versions):
      - Maven builds the JARs locally first
      - `build.sh` copies them to `python/flink_agents/lib/`
      - When `build_wheel` runs, `_download_jar` detects the JARs already exist 
and skips the download (see `backend.py:152-154`)
      - For `-SNAPSHOT` versions, Maven Central doesn't have them, but since 
local JARs exist, no download is attempted
   
   2. **Distribution:** Correct, we will only publish **sdist** (`.tar.gz`) to 
PyPI, not wheel files. The wheel is built on the user's machine during `pip 
install` from sdist, and includes the downloaded JARs.
   
   3. **Dependency Management:** There's no runtime dependency resolution for 
JARs. The JARs are downloaded at **build time** with **fixed SHA-256 
checksums** specified in `jar_manifest.json` included in the sdist. This 
ensures users get the exact same JARs that were tested at release time - no 
version drift is possible. Python dependencies are managed normally through 
`pyproject.toml`.



-- 
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