Skip to content

Commit d698382

Browse files
Merge branch 'main' into RFC-Doc-File-Format-API
2 parents c7924ec + 28c4800 commit d698382

26 files changed

Lines changed: 2681 additions & 6589 deletions

.github/actions/overwrite-package-version/action.yml

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,24 @@
1616
# under the License.
1717

1818
name: 'Update Package Version'
19-
description: 'Updates pyproject.toml version with a provided timestamp'
19+
description: 'Sets a PEP 440 version in pyproject.toml for Python builds'
2020
inputs:
21-
timestamp:
22-
description: 'Timestamp to override to the package version'
21+
version:
22+
description: 'PEP 440 version to set in pyproject.toml'
2323
required: true
2424
runs:
2525
using: "composite"
2626
steps:
27-
- name: Setup Python
28-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
29-
with:
30-
python-version: '3.12'
31-
32-
- name: Install toml
33-
run: pip install toml
27+
- name: Install toml-cli
28+
run: cargo install toml-cli
3429
shell: bash
3530

36-
- name: Get and update version
31+
- name: Set pyproject version
3732
shell: bash
3833
env:
39-
TIMESTAMP: ${{ inputs.timestamp }}
34+
VERSION: ${{ inputs.version }}
4035
run: |
41-
# Read the current version from the Rust crate's Cargo.toml
42-
CURRENT_VERSION=$(python -c "import toml; print(toml.load('bindings/python/Cargo.toml')['package']['version'])")
43-
export NEW_VERSION="${CURRENT_VERSION}.dev${TIMESTAMP}"
44-
echo "Current version: ${CURRENT_VERSION}"
45-
echo "New dev version: ${NEW_VERSION}"
46-
47-
# Update bindings/python/pyproject.toml:
48-
# - Set project.version = NEW_VERSION
49-
# - Ensure 'version' is not listed in project.dynamic
50-
python -c "
51-
import toml
52-
import os
53-
config = toml.load('bindings/python/pyproject.toml')
54-
new_version = os.environ['NEW_VERSION']
55-
config['project']['version'] = new_version
56-
if 'dynamic' in config['project']:
57-
config['project']['dynamic'] = [v for v in config['project']['dynamic'] if v != 'version']
58-
with open('bindings/python/pyproject.toml', 'w') as f:
59-
toml.dump(config, f)
60-
print(f'Updated version to: {new_version}')
61-
"
36+
echo "Setting pyproject version to: ${VERSION}"
37+
PYPROJECT="bindings/python/pyproject.toml"
38+
toml set "$PYPROJECT" project.version "${VERSION}" > tmp.toml && mv tmp.toml "$PYPROJECT"
39+
sed 's/dynamic = \["version"\]/dynamic = []/' "$PYPROJECT" > tmp.toml && mv tmp.toml "$PYPROJECT"

.github/workflows/bindings_python_ci.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
paths:
2626
- '**' # Include all files and directories in the repository by default.
2727
- '!.github/ISSUE_TEMPLATE/**' # Exclude files and directories that don't impact tests or code like templates, metadata, and documentation.
28-
- '!scripts/**'
28+
- '!dev/release/**'
2929
- '!website/**'
3030
- '!.asf.yml'
3131
- '!.gitattributes'
@@ -44,19 +44,6 @@ permissions:
4444
contents: read
4545

4646
jobs:
47-
check-rust:
48-
runs-on: ubuntu-latest
49-
steps:
50-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51-
with:
52-
persist-credentials: false
53-
- name: Check format
54-
working-directory: "bindings/python"
55-
run: cargo fmt --all -- --check
56-
- name: Check clippy
57-
working-directory: "bindings/python"
58-
run: cargo clippy --all-targets --all-features -- -D warnings
59-
6047
check-python:
6148
runs-on: ubuntu-slim
6249
steps:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
paths:
2626
- '**' # Include all files and directories in the repository by default.
2727
- '!.github/ISSUE_TEMPLATE/**' # Exclude files and directories that don't impact tests or code like templates, metadata, and documentation.
28-
- '!scripts/**'
28+
- '!dev/release/**'
2929
- '!website/**'
3030
- '!.asf.yml'
3131
- '!.gitattributes'

.github/workflows/release_python.yml

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ jobs:
7272
BASE_VERSION="${CARGO_VERSION%-rc.*}"
7373
echo "Base version (for Cargo.toml comparison): $BASE_VERSION"
7474
75-
# Read version from Cargo.toml and validate it matches
76-
CARGO_TOML_VERSION=$(grep '^version = ' bindings/python/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
77-
echo "Version in bindings/python/Cargo.toml: $CARGO_TOML_VERSION"
75+
# Read workspace version via cargo metadata
76+
CARGO_TOML_VERSION=$(cargo metadata --format-version 1 --no-deps -q | jq -r '.packages[0].version')
77+
echo "Workspace version: $CARGO_TOML_VERSION"
7878
7979
if [ "$BASE_VERSION" != "$CARGO_TOML_VERSION" ]; then
8080
echo "❌ Version mismatch!"
8181
echo " Release tag base version: $BASE_VERSION"
82-
echo " bindings/python/Cargo.toml version: $CARGO_TOML_VERSION"
82+
echo " Cargo.toml (workspace) version: $CARGO_TOML_VERSION"
8383
echo "Please ensure the release tag matches the version in Cargo.toml"
8484
exit 1
8585
fi
86-
echo "✅ Version matches bindings/python/Cargo.toml"
86+
echo "✅ Version matches workspace Cargo.toml"
8787
fi
8888
8989
# Check if this is a release candidate
@@ -107,22 +107,20 @@ jobs:
107107
with:
108108
persist-credentials: false
109109

110-
- name: Install toml-cli
110+
- name: Compute RC version
111111
if: ${{ needs.validate-release-tag.outputs.is-rc == 'true' }}
112-
run: cargo install toml-cli
113-
114-
- name: Set cargo version for RC
115-
if: ${{ needs.validate-release-tag.outputs.is-rc == 'true' }}
116-
working-directory: "bindings/python"
117-
run: |
118-
echo "Setting cargo version to: ${NEEDS_VALIDATE_RELEASE_TAG_OUTPUTS_CARGO_VERSION}"
119-
toml set Cargo.toml package.version "${NEEDS_VALIDATE_RELEASE_TAG_OUTPUTS_CARGO_VERSION}" > Cargo.toml.tmp
120-
# doing this explicitly to avoid issue in Windows where `mv` does not overwrite existing file
121-
rm Cargo.toml
122-
mv Cargo.toml.tmp Cargo.toml
112+
id: version
123113
shell: bash
124114
env:
125-
NEEDS_VALIDATE_RELEASE_TAG_OUTPUTS_CARGO_VERSION: ${{ needs.validate-release-tag.outputs.cargo-version }}
115+
CARGO_VERSION: ${{ needs.validate-release-tag.outputs.cargo-version }}
116+
run: |
117+
# Convert semver RC (0.9.0-rc.1) to PEP 440 (0.9.0rc1)
118+
echo "pep440=$(echo "$CARGO_VERSION" | sed 's/-rc\.\([0-9]*\)/rc\1/')" >> $GITHUB_OUTPUT
119+
120+
- uses: ./.github/actions/overwrite-package-version
121+
if: ${{ needs.validate-release-tag.outputs.is-rc == 'true' }}
122+
with:
123+
version: ${{ steps.version.outputs.pep440 }}
126124

127125
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
128126
with:
@@ -156,22 +154,20 @@ jobs:
156154
with:
157155
persist-credentials: false
158156

159-
- name: Install toml-cli
160-
if: ${{ needs.validate-release-tag.outputs.is-rc == 'true' }}
161-
run: cargo install toml-cli
162-
163-
- name: Set cargo version for RC
157+
- name: Compute RC version
164158
if: ${{ needs.validate-release-tag.outputs.is-rc == 'true' }}
165-
working-directory: "bindings/python"
159+
id: version
166160
shell: bash
167161
env:
168162
CARGO_VERSION: ${{ needs.validate-release-tag.outputs.cargo-version }}
169163
run: |
170-
echo "Setting cargo version to: $CARGO_VERSION"
171-
toml set Cargo.toml package.version "$CARGO_VERSION" > Cargo.toml.tmp
172-
# doing this explicitly to avoid issue in Windows where `mv` does not overwrite existing file
173-
rm Cargo.toml
174-
mv Cargo.toml.tmp Cargo.toml
164+
# Convert semver RC (0.9.0-rc.1) to PEP 440 (0.9.0rc1)
165+
echo "pep440=$(echo "$CARGO_VERSION" | sed 's/-rc\.\([0-9]*\)/rc\1/')" >> $GITHUB_OUTPUT
166+
167+
- uses: ./.github/actions/overwrite-package-version
168+
if: ${{ needs.validate-release-tag.outputs.is-rc == 'true' }}
169+
with:
170+
version: ${{ steps.version.outputs.pep440 }}
175171

176172
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
177173
with:
@@ -190,7 +186,7 @@ jobs:
190186
manylinux: ${{ matrix.manylinux || 'auto' }}
191187
working-directory: "bindings/python"
192188
command: build
193-
args: --release -o dist -i python3.12 # Explicitly set interpreter; manylinux containers have multiple Pythons and maturin may pick an older one
189+
args: --profile py-release -o dist -i python3.12 # Explicitly set interpreter; manylinux containers have multiple Pythons and maturin may pick an older one
194190
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
195191
with:
196192
version: "0.9.3"

.github/workflows/release_python_nightly.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,18 @@ jobs:
4444
with:
4545
persist-credentials: false
4646

47-
- uses: ./.github/actions/overwrite-package-version # Overwrite package version with timestamp
47+
- name: Compute dev version
48+
id: version
49+
shell: bash
50+
env:
51+
TIMESTAMP: ${{ needs.set-version.outputs.timestamp }}
52+
run: |
53+
CURRENT=$(cargo metadata --format-version 1 --no-deps -q | jq -r '.packages[0].version')
54+
echo "pep440=${CURRENT}.dev${TIMESTAMP}" >> $GITHUB_OUTPUT
55+
56+
- uses: ./.github/actions/overwrite-package-version
4857
with:
49-
timestamp: ${{ needs.set-version.outputs.TIMESTAMP }}
58+
version: ${{ steps.version.outputs.pep440 }}
5059

5160
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
5261
with:
@@ -81,9 +90,18 @@ jobs:
8190
with:
8291
persist-credentials: false
8392

84-
- uses: ./.github/actions/overwrite-package-version # Overwrite package version with timestamp
93+
- name: Compute dev version
94+
id: version
95+
shell: bash
96+
env:
97+
TIMESTAMP: ${{ needs.set-version.outputs.timestamp }}
98+
run: |
99+
CURRENT=$(cargo metadata --format-version 1 --no-deps -q | jq -r '.packages[0].version')
100+
echo "pep440=${CURRENT}.dev${TIMESTAMP}" >> $GITHUB_OUTPUT
101+
102+
- uses: ./.github/actions/overwrite-package-version
85103
with:
86-
timestamp: ${{ needs.set-version.outputs.TIMESTAMP }}
104+
version: ${{ steps.version.outputs.pep440 }}
87105

88106
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
89107
with:
@@ -104,7 +122,7 @@ jobs:
104122
manylinux: ${{ matrix.manylinux || 'auto' }}
105123
working-directory: "bindings/python"
106124
command: build
107-
args: --release -o dist -i python3.12 # Explicitly set interpreter; manylinux containers have multiple Pythons and maturin may pick an older one
125+
args: --profile py-release -o dist -i python3.12 # Explicitly set interpreter; manylinux containers have multiple Pythons and maturin may pick an older one
108126

109127
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
110128
with:

AGENTS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# Apache Iceberg Rust — Agent Instructions
21+
22+
This file provides repository-specific guidance for automated agents working
23+
in this repository.
24+
25+
## Security Model
26+
27+
When assessing potential vulnerabilities or calibrating automated security
28+
findings, use [`SECURITY-THREAT-MODEL.md`](SECURITY-THREAT-MODEL.md) as the
29+
authoritative detailed description of this repository's security boundaries,
30+
trust assumptions, and non-boundaries.

0 commit comments

Comments
 (0)