diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index a721355198..77abd91c8f 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -18,14 +18,10 @@ name: Publish Python 🐍 distribution 📦 to PyPI on: - push: - tags: - - "*" - pull_request: - branches: - - main - paths: - - ".github/workflows/release_python.yml" + workflow_run: + workflows: ["Publish"] # Trigger this workflow after the "publish.yml" workflow completes + types: + - completed workflow_dispatch: env: @@ -39,8 +35,16 @@ permissions: contents: read jobs: + check-cargo-publish: + runs-on: ubuntu-latest + # Only run if the triggering workflow succeeded OR if manually triggered + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} + steps: + - run: echo 'The Publish workflow passed or was manually triggered' + sdist: runs-on: ubuntu-latest + needs: [check-cargo-publish] steps: - uses: actions/checkout@v4 - uses: PyO3/maturin-action@v1 @@ -56,6 +60,7 @@ jobs: wheels: runs-on: "${{ matrix.os }}" + needs: [check-cargo-publish] strategy: matrix: include: @@ -94,8 +99,8 @@ jobs: name: Publish Python 🐍 distribution 📦 to Pypi needs: [sdist, wheels] runs-on: ubuntu-latest - # Only publish to PyPi if the tag is not a pre-release - if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') }} + # Only publish to PyPi if the tag is not a pre-release OR if manually triggered + if: ${{ (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')) || github.event_name == 'workflow_dispatch' }} environment: name: pypi diff --git a/Cargo.lock b/Cargo.lock index 10fa7621eb..d2d6bb6514 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3499,7 +3499,6 @@ dependencies = [ "expect-test", "fnv", "futures", - "iceberg-catalog-memory", "iceberg_test_utils", "itertools 0.13.0", "moka", diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index 471b0cbe9f..3324a4e9e3 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -90,7 +90,6 @@ zstd = { workspace = true } [dev-dependencies] ctor = { workspace = true } expect-test = { workspace = true } -iceberg-catalog-memory = { workspace = true } iceberg_test_utils = { path = "../test_utils", features = ["tests"] } pretty_assertions = { workspace = true } rand = { workspace = true } diff --git a/crates/iceberg/src/lib.rs b/crates/iceberg/src/lib.rs index 556ff3e02f..6de2038985 100644 --- a/crates/iceberg/src/lib.rs +++ b/crates/iceberg/src/lib.rs @@ -21,7 +21,9 @@ //! //! ## Scan A Table //! -//! ```rust, no_run +//! ```rust, ignore +//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. +//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. //! use futures::TryStreamExt; //! use iceberg::io::{FileIO, FileIOBuilder}; //! use iceberg::{Catalog, Result, TableIdent}; diff --git a/crates/iceberg/src/writer/mod.rs b/crates/iceberg/src/writer/mod.rs index 2a6aa802bf..26e1991911 100644 --- a/crates/iceberg/src/writer/mod.rs +++ b/crates/iceberg/src/writer/mod.rs @@ -38,7 +38,9 @@ //! own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example) //! //! # Simple example for the data file writer used parquet physical format: -//! ```rust, no_run +//! ```rust, ignore +//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. +//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. //! use std::sync::Arc; //! //! use arrow_array::{ArrayRef, BooleanArray, Int32Array, RecordBatch, StringArray}; @@ -95,7 +97,9 @@ //! ``` //! //! # Custom writer to record latency -//! ```rust, no_run +//! ```rust, ignore +//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. +//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. //! use std::time::Instant; //! //! use arrow_array::RecordBatch;