@@ -144,3 +144,111 @@ jobs:
144144 cd python
145145 uv run dev/lint-python
146146 uv run dev/pytest
147+
148+ python-release-build :
149+ runs-on : ubuntu-latest
150+ steps :
151+ - name : Checkout repository
152+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
153+ - name : Install Python and uv
154+ uses : astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
155+ with :
156+ python-version : " 3.10"
157+ - name : Install twine
158+ run : uv tool install twine
159+ - name : Build delta-sharing package
160+ run : |
161+ cd python
162+ uv build
163+ - name : Build delta-kernel-rust-sharing-wrapper distribution
164+ run : |
165+ cargo install cargo-zigbuild
166+ cd python
167+ uv run maturin build \
168+ --manifest-path delta-kernel-rust-sharing-wrapper/Cargo.toml \
169+ --release \
170+ --sdist \
171+ - name : Check built distributions
172+ run : |
173+ cd python
174+ uv run twine check --strict dist/*
175+ uv run twine check --strict delta-kernel-rust-sharing-wrapper/target/wheels/*
176+ - name : Upload distributions
177+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
178+ with :
179+ name : python-release-distributions
180+ path : |
181+ python/dist/*
182+ python/delta-kernel-rust-sharing-wrapper/target/wheels/*
183+ if-no-files-found : error
184+
185+ # Install the wheels built by python-release-build on an older Ubuntu image
186+ # so we catch glibc / shared-library regressions that ubuntu-24.04 would
187+ # otherwise hide.
188+ python-release-test :
189+ needs : python-release-build
190+ runs-on : ubuntu-22.04
191+ env :
192+ SPARK_LOCAL_IP : localhost
193+ GOOGLE_APPLICATION_CREDENTIALS : /tmp/google_service_account_key.json
194+ steps :
195+ - name : Checkout repository
196+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
197+ - name : Cache Scala, SBT
198+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
199+ with :
200+ path : |
201+ ~/.sbt
202+ ~/.ivy2
203+ ~/.cache/coursier
204+ key : build-and-test-python-release-test
205+ - name : Install Java 8
206+ uses : actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
207+ with :
208+ distribution : ' zulu'
209+ java-version : ' 8'
210+ - name : Install Python and uv
211+ uses : astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
212+ with :
213+ python-version : " 3.10"
214+ - name : Download built wheels
215+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
216+ with :
217+ name : python-release-distributions
218+ path : built-wheels/
219+ - name : Install built wheels into a fresh venv
220+ run : |
221+ set -euo pipefail
222+ shopt -s failglob
223+ uv venv /tmp/release-venv --python 3.10
224+ # actions/upload-artifact@v4 collapses the LCA, so paths inside the
225+ # artifact start at `dist/` and `delta-kernel-rust-sharing-wrapper/`,
226+ # not `python/dist/` and `python/delta-kernel-rust-sharing-wrapper/`.
227+ uv pip install --python /tmp/release-venv/bin/python \
228+ built-wheels/delta-kernel-rust-sharing-wrapper/target/wheels/*.whl \
229+ built-wheels/dist/*.whl \
230+ pytest
231+ # The published wheel intentionally excludes delta_sharing.tests, but
232+ # the test files import from `delta_sharing.tests.conftest`. Copy the
233+ # tests subpackage into the installed location so the import works.
234+ site_packages=$(/tmp/release-venv/bin/python -c "import sysconfig; print(sysconfig.get_paths()['purelib'])")
235+ cp -r python/delta_sharing/tests "$site_packages/delta_sharing/tests"
236+ # Rename the source package so it does not shadow the installed wheel
237+ # when pytest runs from python/ (cwd is needed for the sbt server fixture).
238+ mv python/delta_sharing python/delta_sharing.src
239+ - name : Build Server
240+ run : ./build/sbt package
241+ - name : Run tests against installed wheels
242+ env :
243+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
244+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
245+ AZURE_TEST_ACCOUNT_KEY : ${{ secrets.AZURE_TEST_ACCOUNT_KEY }}
246+ GOOGLE_SERVICE_ACCOUNT_KEY : ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
247+ run : |
248+ cd python
249+ /tmp/release-venv/bin/python -m pytest \
250+ --verbose --showlocals --color=yes \
251+ --doctest-modules --pyargs delta_sharing \
252+ --ignore-glob='*/_yarl_patch.py' \
253+ -o log_cli=true -s
254+
0 commit comments