leaves12138 commented on code in PR #11:
URL: https://github.com/apache/paimon-mosaic/pull/11#discussion_r3271403782


##########
tools/releasing/update_branch_version.sh:
##########
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+MVN=${MVN:-mvn}
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+###########################
+
+OLD_VERSION=${OLD_VERSION}
+NEW_VERSION=${NEW_VERSION}
+
+
+if [ -z "${OLD_VERSION}" ]; then
+       echo "OLD_VERSION is unset"
+       exit 1
+fi
+
+if [ -z "${NEW_VERSION}" ]; then
+       echo "NEW_VERSION is unset"
+       exit 1
+fi
+
+cd ..
+
+#change version in all pom files
+find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;

Review Comment:
   This version bump only updates `pom.xml`. The PR also adds Rust and Python 
publishing workflows, whose published versions come from `core/Cargo.toml`, 
`ffi/Cargo.toml`, `jni/Cargo.toml`, and `python/pyproject.toml`. After creating 
a new release branch/tag, crates.io/PyPI could still publish the old `0.1.0` 
version while Maven publishes the new one. Please update all language manifests 
(and `Cargo.lock` if needed), or add release-time checks that the tag version 
matches every published package manifest.



##########
.github/workflows/release-python.yml:
##########
@@ -0,0 +1,148 @@
+# 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.
+
+# Publish the mosaic-format Python package to PyPI.
+#
+# Trigger: push a version tag (e.g. v0.1.0, v0.1.0-rc1).
+# Pre-release tags (containing '-') publish to TestPyPI; release tags publish 
to PyPI.
+#
+# Token auth: add secrets PYPI_API_TOKEN / TEST_PYPI_API_TOKEN for publishing.
+
+name: Release Python
+
+on:
+  push:
+    tags:
+      - "v[0-9]+.[0-9]+.[0-9]+"
+      - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  sdist:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v6
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.12"
+
+      - name: Install build tools
+        run: pip install build
+
+      - name: Build sdist
+        working-directory: python
+        run: python -m build --sdist

Review Comment:
   This sdist is built from a fresh checkout before any native library is 
built, and `setup.py` does not build `mosaic-ffi` from source. In a clean 
checkout the generated sdist contains neither `libmosaic_ffi.*` nor the Cargo 
sources needed to build it, so installing from the sdist produces a package 
that fails at import time when `_ffi.py` cannot find the native library. Please 
either make the sdist build the Rust library from source (similar to 
paimon-rust's maturin-based sdist) or do not publish a broken sdist.



##########
.github/workflows/release-python.yml:
##########
@@ -0,0 +1,148 @@
+# 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.
+
+# Publish the mosaic-format Python package to PyPI.
+#
+# Trigger: push a version tag (e.g. v0.1.0, v0.1.0-rc1).
+# Pre-release tags (containing '-') publish to TestPyPI; release tags publish 
to PyPI.
+#
+# Token auth: add secrets PYPI_API_TOKEN / TEST_PYPI_API_TOKEN for publishing.
+
+name: Release Python
+
+on:
+  push:
+    tags:
+      - "v[0-9]+.[0-9]+.[0-9]+"
+      - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  sdist:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v6
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.12"
+
+      - name: Install build tools
+        run: pip install build
+
+      - name: Build sdist
+        working-directory: python
+        run: python -m build --sdist
+
+      - name: Upload sdist
+        uses: actions/upload-artifact@v7
+        with:
+          name: wheels-sdist
+          path: python/dist/*.tar.gz
+
+  wheels:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - os: ubuntu-latest
+            target: x86_64-unknown-linux-gnu
+            lib_name: libmosaic_ffi.so
+          - os: ubuntu-24.04-arm
+            target: aarch64-unknown-linux-gnu
+            lib_name: libmosaic_ffi.so
+          - os: macos-13
+            target: x86_64-apple-darwin
+            lib_name: libmosaic_ffi.dylib
+          - os: macos-latest
+            target: aarch64-apple-darwin
+            lib_name: libmosaic_ffi.dylib
+          - os: windows-latest
+            target: x86_64-pc-windows-msvc
+            lib_name: mosaic_ffi.dll
+    steps:
+      - uses: actions/checkout@v6
+
+      - name: Setup Rust toolchain
+        run: |
+          rustup update stable
+          rustup default stable
+
+      - name: Build native library
+        run: cargo build --release -p mosaic-ffi
+
+      - name: Copy native library into package
+        shell: bash
+        run: cp target/release/${{ matrix.lib_name }} python/mosaic/
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.12"
+
+      - name: Install build tools
+        run: pip install build wheel setuptools
+
+      - name: Build wheel
+        working-directory: python
+        run: python -m build --wheel

Review Comment:
   Plain `python -m build --wheel` creates native Linux wheels with tags like 
`cp312-cp312-linux_x86_64`/`linux_aarch64` (locally I reproduced 
`mosaic_format-0.1.0-cp310-cp310-linux_x86_64.whl`). These are not manylinux 
wheels and are not suitable for PyPI release. This also unnecessarily restricts 
a ctypes-only package to the single Python version used by the workflow. Please 
use a manylinux-aware wheel builder such as `cibuildwheel` + `auditwheel`, or 
follow paimon-rust's maturin/manylinux approach.



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