esafak commented on code in PR #2381:
URL: https://github.com/apache/fory/pull/2381#discussion_r2188294443


##########
ci/deploy.sh:
##########
@@ -132,38 +81,32 @@ build_pyfory() {
   fi
 
   python setup.py bdist_wheel --dist-dir=../dist
-  popd
-}
 
-deploy_python() {
-  source $(conda info --base)/etc/profile.d/conda.sh
-  if command -v pyenv; then
-    pyenv local system
+  if [ -n "$PLAT" ]; then
+    # In manylinux container, repair the wheel to embed shared libraries
+    # and rename the wheel with the manylinux tag.
+    PYARROW_LIB_DIR=$(python -c 'import pyarrow; 
print(":".join(pyarrow.get_library_dirs()))')
+    export LD_LIBRARY_PATH="$PYARROW_LIB_DIR:$LD_LIBRARY_PATH"
+    auditwheel repair ../dist/pyfory-*-linux_*.whl --plat "$PLAT" -w ../dist/
+    rm ../dist/pyfory-*-linux_*.whl
+  elif [[ "$OSTYPE" == "darwin"* ]]; then
+    # macOS: use delocate to bundle dependencies and fix wheel tags
+    pip install delocate
+    mkdir -p ../dist_repaired
+    delocate-wheel -w ../dist_repaired/ ../dist/pyfory-*-macosx*.whl
+    rm ../dist/pyfory-*-macosx*.whl
+    mv ../dist_repaired/* ../dist/
+    rmdir ../dist_repaired
+  elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
+    # Windows: use delvewheel to bundle dependencies
+    pip install delvewheel
+    mkdir -p ../dist_repaired
+    delvewheel repair ../dist/pyfory-*-win*.whl -w ../dist_repaired/
+    rm ../dist/pyfory-*-win*.whl
+    mv ../dist_repaired/* ../dist/
+    rmdir ../dist_repaired
   fi
-  cd "$ROOT/python"
-  rm -rf "$WHEEL_DIR"
-  mkdir -p "$WHEEL_DIR"
-  for ((i=0; i<${#PYTHONS[@]}; ++i)); do
-    PYTHON=${PYTHONS[i]}
-    ENV="py${VERSIONS[i]}"
-    conda activate "$ENV"
-    python -V
-    git clean -f -f -x -d -e .whl
-    # Ensure bazel select the right version of python
-    bazel clean --expunge
-    install_pyarrow
-    pip install --ignore-installed twine setuptools cython numpy
-    pyarrow_dir=$(python -c "import importlib.util; import os; 
print(os.path.dirname(importlib.util.find_spec('pyarrow').origin))")
-    # ensure pyarrow is clean
-    rm -rf "$pyarrow_dir"
-    pip install --ignore-installed pyarrow==$pyarrow_version
-    python setup.py clean
-    python setup.py bdist_wheel
-    mv dist/pyfory*.whl "$WHEEL_DIR"
-  done
-  rename_wheels "$WHEEL_DIR"
-  twine check "$WHEEL_DIR"/pyfory*.whl
-  twine upload -r pypi "$WHEEL_DIR"/pyfory*.whl

Review Comment:
   Only if you do it manually. CI uses the 
   
[pypa/gh-action-pypi-publish@release/v1](https://github.com/apache/fory/blob/main/.github/workflows/release.yaml#L74-L79)
 action. If you don't need that functionality I suggest removing it to simplify 
the codebase.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to