Skip to content

Commit 7944e95

Browse files
committed
Make build and test Python work with preview versions
1 parent 6006ffb commit 7944e95

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/actions/build-whl/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ runs:
3737
git diff
3838
shell: bash
3939

40+
- name: Make this work with PySpark preview versions
41+
if: contains(inputs.spark-version, 'preview')
42+
run: |
43+
sed -i -e 's/f"\(pyspark~=.*\)"/f"\1.dev1"/' -e 's/f"\({spark_compat_version}.0\)"/"${{ inputs.spark-version }}"/g' python/setup.py
44+
git diff python/setup.py
45+
shell: bash
46+
4047
- name: Restore Maven packages cache
4148
if: github.event_name != 'schedule'
4249
uses: actions/cache/restore@v4
@@ -87,7 +94,8 @@ runs:
8794
# Test whl
8895
echo "::group::test-release.py"
8996
twine check python/dist/*
90-
pip install python/dist/*.whl "pyspark~=${{ inputs.spark-compat-version }}.0"
97+
# .dev1 allows this to work with preview versions
98+
pip install python/dist/*.whl "pyspark~=${{ inputs.spark-compat-version }}.0.dev1"
9199
python test-release.py
92100
echo "::endgroup::"
93101
shell: bash

.github/actions/test-python/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ runs:
5252
echo "SPARK_EXTENSION_VERSION=$SPARK_EXTENSION_VERSION" | tee -a "$GITHUB_ENV"
5353
shell: bash
5454

55+
- name: Make this work with PySpark preview versions
56+
if: contains(inputs.spark-version, 'preview')
57+
run: |
58+
sed -i -e 's/\({spark_compat_version}.0\)"/\1.dev1"/' python/setup.py
59+
git diff python/setup.py
60+
shell: bash
61+
5562
- name: Restore Spark Binaries cache
5663
if: github.event_name != 'schedule' && ( startsWith(inputs.spark-version, '3.') && inputs.scala-compat-version == '2.12' || startsWith(inputs.spark-version, '4.') ) && ! contains(inputs.spark-version, '-SNAPSHOT')
5764
uses: actions/cache/restore@v4
@@ -195,7 +202,8 @@ runs:
195202
# Python Unit Tests (Spark Connect)
196203
197204
echo "::group::pip install"
198-
.pytest-venv/bin/pip install "pyspark[connect]~=${{ inputs.spark-compat-version }}.0"
205+
# .dev1 allows this to work with preview versions
206+
.pytest-venv/bin/pip install "pyspark[connect]~=${{ inputs.spark-compat-version }}.0.dev1"
199207
echo "::endgroup::"
200208
201209
.pytest-venv/bin/python -m pytest python/test --junit-xml test-results-connect/pytest-$(date +%s.%N)-$RANDOM.xml

0 commit comments

Comments
 (0)