davisp commented on code in PR #1375:
URL: 
https://github.com/apache/datafusion-python/pull/1375#discussion_r2789802894


##########
.github/workflows/release.yml:
##########
@@ -0,0 +1,49 @@
+# 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.
+
+# Release workflow - runs tests in RELEASE mode and builds distribution wheels
+# Triggered on:
+#   - Merges to main
+#   - Release candidate tags (*-rc*)
+#   - Release tags (e.g., 45.0.0)
+
+name: Release Build
+
+on:
+  push:
+    branches:
+      - "main"
+    tags:
+      - "*-rc*"      # Release candidates (e.g., 45.0.0-rc1)

Review Comment:
   Should we add the `[0-9]+` prefix here?



##########
.github/workflows/build.yml:
##########
@@ -312,7 +462,7 @@ jobs:
       - name: Setup Python
         uses: actions/setup-python@v6
         with:
-          python-version: "3.11"
+          python-version: "3.10"

Review Comment:
   I assume there's a reason to downgrade here. I'd just thought I'd flag it in 
case it wasn't intentional.



##########
examples/datafusion-ffi-example/.cargo/config.toml:
##########
@@ -1,12 +1,5 @@
 [target.x86_64-apple-darwin]
-rustflags = [
-  "-C", "link-arg=-undefined",
-  "-C", "link-arg=dynamic_lookup",
-]
+rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

Review Comment:
   Not sure if we care, but near as I can tell, everything below here is just 
reformatting code.



##########
.github/workflows/build.yml:
##########
@@ -15,61 +15,235 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: Python Release Build
+# Reusable workflow for running building
+# This ensures the same tests run for both debug (PRs) and release (main/tags) 
builds
+
+name: Build
+
 on:
-  pull_request:
-    branches: ["main"]
-  push:
-    tags: ["*-rc*"]
-    branches: ["branch-*"]
+  workflow_call:
+    inputs:
+      build_mode:
+        description: 'Build mode: debug or release'
+        required: true
+        type: string
+      run_wheels:
+        description: 'Whether to build distribution wheels'
+        required: false
+        type: boolean
+        default: false
+
+env:
+  CARGO_TERM_COLOR: always
+  RUST_BACKTRACE: 1
 
 jobs:
-  build:
+  # ============================================
+  # Linting Jobs
+  # ============================================
+  lint-rust:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v6
+
+      - name: Setup Rust
+        uses: dtolnay/rust-toolchain@stable
+        with:
+          toolchain: "nightly"
+          components: rustfmt
+
+      - name: Cache Cargo
+        uses: Swatinem/rust-cache@v2
+
+      - name: Check formatting
+        run: cargo +nightly fmt --all -- --check
+
+  lint-python:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v6
+
       - name: Install Python
-        uses: actions/setup-python@v6
+        uses: actions/setup-python@v5
         with:
           python-version: "3.12"
 
-      - uses: astral-sh/setup-uv@v7
+      - uses: astral-sh/setup-uv@v6
         with:
-            enable-cache: true
+          enable-cache: true
 
-      # Use the --no-install-package to only install the dependencies
-      # but do not yet build the rust library
       - name: Install dependencies
         run: uv sync --dev --no-install-package datafusion
 
-      # Update output format to enable automatic inline annotations.
       - name: Run Ruff
         run: |
           uv run --no-project ruff check --output-format=github python/
           uv run --no-project ruff format --check python/
 
       - name: Run codespell
         run: |
-            uv run --no-project codespell --toml pyproject.toml
+          uv run --no-project codespell --toml pyproject.toml
+
+  lint-toml:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v6
+
+      - name: Install taplo
+        uses: taiki-e/install-action@v2
+        with:
+          tool: taplo-cli
+
+      # if you encounter an error, try running 'taplo format' to fix the 
formatting automatically.
+      - name: Check Cargo.toml formatting
+        run: taplo format --check
 
   generate-license:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v6
-      - uses: astral-sh/setup-uv@v7
+
+      - uses: astral-sh/setup-uv@v6
+        with:
+          enable-cache: true
+
+      - name: Install cargo-license
+        uses: taiki-e/install-action@v2
         with:
-            enable-cache: true
+          tool: cargo-license
 
       - name: Generate license file
         run: uv run --no-project python ./dev/create_license.py
+
       - uses: actions/upload-artifact@v6
         with:
           name: python-wheel-license
           path: LICENSE.txt
 
+  # ============================================
+  # Build - Linux x86_64
+  # ============================================
+  build-manylinux-x86_64:
+    needs: [generate-license, lint-rust, lint-python]
+    name: ManyLinux x86_64
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v6
+
+      - run: rm LICENSE.txt
+      - name: Download LICENSE.txt
+        uses: actions/download-artifact@v7
+        with:
+          name: python-wheel-license
+          path: .
+
+      - name: Setup Rust
+        uses: dtolnay/rust-toolchain@stable
+
+      - name: Cache Cargo
+        uses: Swatinem/rust-cache@v2
+        with:
+          key: ${{ inputs.build_mode }}
+
+      - uses: astral-sh/setup-uv@v6
+        with:
+          enable-cache: true
+
+      - name: Build (release mode)
+        uses: PyO3/maturin-action@v1
+        if: inputs.build_mode == 'release'
+        with:
+          target: x86_64-unknown-linux-gnu
+          manylinux: "2_28"
+          args: --release --strip --features protoc,substrait --out dist

Review Comment:
   Not sure if its important. but the linux wheels are built with the `protoc` 
feature enabled, but the windows and mac wheels don't include it.



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