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