Skip to content

Commit 48433cb

Browse files
authored
fix 0.5.x release cargo publish (#1379)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## What changes are included in this PR? <!-- Provide a summary of the modifications in this PR. List the main changes such as new features, bug fixes, refactoring, or any other updates. --> This PR removes `iceberg-catalog-memory` as a dev-dependency of `crates/iceberg`. The dependency is not used and caused `cargo publish` to fail during the 0.5.0 release (See #1325 (comment)) This PR also changes `.github/workflows/release_python.yml` to depend on `publish.yml` since we only want to publish `pyiceberg-core` to pypi after the crates are successfully published. https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow ## Are these changes tested? <!-- Specify what test covers (unit test, integration test, etc.). If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> Yes, I tested the github action changes by pushing this PR to my fork's `main` and then push a new tag, with some minor changes so that the github action can run succesfully. The tag push triggered the `Publish` workflow (https://github.com/kevinjqliu/iceberg-rust/actions/runs/15265739052) which ran successfully and triggered the `Publish Python 🐍 distribution 📦 to PyPI` workflow (https://github.com/kevinjqliu/iceberg-rust/actions/runs/15265757444)
1 parent 18a44cd commit 48433cb

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

.github/workflows/release_python.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@
1818
name: Publish Python 🐍 distribution 📦 to PyPI
1919

2020
on:
21-
push:
22-
tags:
23-
- "*"
24-
pull_request:
25-
branches:
26-
- main
27-
paths:
28-
- ".github/workflows/release_python.yml"
21+
workflow_run:
22+
workflows: ["Publish"] # Trigger this workflow after the "publish.yml" workflow completes
23+
types:
24+
- completed
2925
workflow_dispatch:
3026

3127
env:
@@ -39,8 +35,16 @@ permissions:
3935
contents: read
4036

4137
jobs:
38+
check-cargo-publish:
39+
runs-on: ubuntu-latest
40+
# Only run if the triggering workflow succeeded OR if manually triggered
41+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
42+
steps:
43+
- run: echo 'The Publish workflow passed or was manually triggered'
44+
4245
sdist:
4346
runs-on: ubuntu-latest
47+
needs: [check-cargo-publish]
4448
steps:
4549
- uses: actions/checkout@v4
4650
- uses: PyO3/maturin-action@v1
@@ -56,6 +60,7 @@ jobs:
5660

5761
wheels:
5862
runs-on: "${{ matrix.os }}"
63+
needs: [check-cargo-publish]
5964
strategy:
6065
matrix:
6166
include:
@@ -94,8 +99,8 @@ jobs:
9499
name: Publish Python 🐍 distribution 📦 to Pypi
95100
needs: [sdist, wheels]
96101
runs-on: ubuntu-latest
97-
# Only publish to PyPi if the tag is not a pre-release
98-
if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') }}
102+
# Only publish to PyPi if the tag is not a pre-release OR if manually triggered
103+
if: ${{ (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-')) || github.event_name == 'workflow_dispatch' }}
99104

100105
environment:
101106
name: pypi

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/iceberg/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ zstd = { workspace = true }
9090
[dev-dependencies]
9191
ctor = { workspace = true }
9292
expect-test = { workspace = true }
93-
iceberg-catalog-memory = { workspace = true }
9493
iceberg_test_utils = { path = "../test_utils", features = ["tests"] }
9594
pretty_assertions = { workspace = true }
9695
rand = { workspace = true }

crates/iceberg/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
//!
2222
//! ## Scan A Table
2323
//!
24-
//! ```rust, no_run
24+
//! ```rust, ignore
25+
//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default.
26+
//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml.
2527
//! use futures::TryStreamExt;
2628
//! use iceberg::io::{FileIO, FileIOBuilder};
2729
//! use iceberg::{Catalog, Result, TableIdent};

crates/iceberg/src/writer/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
//! own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example)
3939
//!
4040
//! # Simple example for the data file writer used parquet physical format:
41-
//! ```rust, no_run
41+
//! ```rust, ignore
42+
//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default.
43+
//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml.
4244
//! use std::sync::Arc;
4345
//!
4446
//! use arrow_array::{ArrayRef, BooleanArray, Int32Array, RecordBatch, StringArray};
@@ -95,7 +97,9 @@
9597
//! ```
9698
//!
9799
//! # Custom writer to record latency
98-
//! ```rust, no_run
100+
//! ```rust, ignore
101+
//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default.
102+
//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml.
99103
//! use std::time::Instant;
100104
//!
101105
//! use arrow_array::RecordBatch;

0 commit comments

Comments
 (0)