Skip to content

Commit 3b14089

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

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

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

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

40+
- name: Make this work with PySpark preview versions
41+
run: |
42+
sed -i -e 's/\({spark_compat_version}.0\)"/\1.dev1"/' python/setup.py
43+
git diff python/setup.py
44+
shell: bash
45+
4046
- name: Restore Maven packages cache
4147
if: github.event_name != 'schedule'
4248
uses: actions/cache/restore@v4
@@ -87,7 +93,8 @@ runs:
8793
# Test whl
8894
echo "::group::test-release.py"
8995
twine check python/dist/*
90-
pip install python/dist/*.whl "pyspark~=${{ inputs.spark-compat-version }}.0"
96+
# .dev1 allows this to work with preview versions
97+
pip install python/dist/*.whl "pyspark~=${{ inputs.spark-compat-version }}.0.dev1"
9198
python test-release.py
9299
echo "::endgroup::"
93100
shell: bash

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ 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+
run: |
57+
sed -i -e 's/\({spark_compat_version}.0\)"/\1.dev1"/' python/setup.py
58+
git diff python/setup.py
59+
shell: bash
60+
5561
- name: Restore Spark Binaries cache
5662
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')
5763
uses: actions/cache/restore@v4
@@ -195,7 +201,8 @@ runs:
195201
# Python Unit Tests (Spark Connect)
196202
197203
echo "::group::pip install"
198-
.pytest-venv/bin/pip install "pyspark[connect]~=${{ inputs.spark-compat-version }}.0"
204+
# .dev1 allows this to work with preview versions
205+
.pytest-venv/bin/pip install "pyspark[connect]~=${{ inputs.spark-compat-version }}.0.dev1"
199206
echo "::endgroup::"
200207
201208
.pytest-venv/bin/python -m pytest python/test --junit-xml test-results-connect/pytest-$(date +%s.%N)-$RANDOM.xml

0 commit comments

Comments
 (0)