Skip to content

Commit

Permalink
[SPARK-47549][BUILD] Remove Spark 3.0~3.2 pyspark/version.py workar…
Browse files Browse the repository at this point in the history
…ound from release scripts

### What changes were proposed in this pull request?

This PR aims to remove Spark 3.0~3.2 `pyspark/version.py` workaround code from release scripts.

This is a logical revert of SPARK-38411 because Spark 3.0~3.3 are the end of support status.

- #36803

### Why are the changes needed?

To simplify the release script for Apache Spark 4+

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Manual review.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #45706 from dongjoon-hyun/SPARK-47549.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
dongjoon-hyun authored and HyukjinKwon committed Mar 26, 2024
1 parent 87cae7b commit a5ea884
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
7 changes: 1 addition & 6 deletions dev/create-release/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,7 @@ if [[ "$1" == "package" ]]; then
# Write out the VERSION to PySpark version info we rewrite the - into a . and SNAPSHOT
# to dev0 to be closer to PEP440.
PYSPARK_VERSION=`echo "$SPARK_VERSION" | sed -e "s/-/./" -e "s/SNAPSHOT/dev0/" -e "s/preview/dev/"`

if [[ $SPARK_VERSION == 3.0* ]] || [[ $SPARK_VERSION == 3.1* ]] || [[ $SPARK_VERSION == 3.2* ]]; then
echo "__version__ = '$PYSPARK_VERSION'" > python/pyspark/version.py
else
echo "__version__: str = '$PYSPARK_VERSION'" > python/pyspark/version.py
fi
echo "__version__: str = '$PYSPARK_VERSION'" > python/pyspark/version.py

# Get maven home set by MVN
MVN_HOME=`$MVN -version 2>&1 | grep 'Maven home' | awk '{print $NF}'`
Expand Down
12 changes: 2 additions & 10 deletions dev/create-release/release-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ fi
sed -i".tmp1" 's/SPARK_VERSION:.*$/SPARK_VERSION: '"$RELEASE_VERSION"'/g' docs/_config.yml
sed -i".tmp2" 's/SPARK_VERSION_SHORT:.*$/SPARK_VERSION_SHORT: '"$RELEASE_VERSION"'/g' docs/_config.yml
sed -i".tmp3" "s/'facetFilters':.*$/'facetFilters': [\"version:$RELEASE_VERSION\"]/g" docs/_config.yml
if [[ $RELEASE_VERSION == 3.0* ]] || [[ $RELEASE_VERSION == 3.1* ]] || [[ $RELEASE_VERSION == 3.2* ]]; then
sed -i".tmp4" 's/__version__ = .*$/__version__ = "'"$RELEASE_VERSION"'"/' python/pyspark/version.py
else
sed -i".tmp4" 's/__version__: str = .*$/__version__: str = "'"$RELEASE_VERSION"'"/' python/pyspark/version.py
fi
sed -i".tmp4" 's/__version__: str = .*$/__version__: str = "'"$RELEASE_VERSION"'"/' python/pyspark/version.py

git commit -a -m "Preparing Spark release $RELEASE_TAG"
echo "Creating tag $RELEASE_TAG at the head of $GIT_BRANCH"
Expand All @@ -102,11 +98,7 @@ R_NEXT_VERSION=`echo $NEXT_VERSION | sed 's/-SNAPSHOT//g'`
sed -i".tmp5" 's/Version.*$/Version: '"$R_NEXT_VERSION"'/g' R/pkg/DESCRIPTION
# Write out the R_NEXT_VERSION to PySpark version info we use dev0 instead of SNAPSHOT to be closer
# to PEP440.
if [[ $RELEASE_VERSION == 3.0* ]] || [[ $RELEASE_VERSION == 3.1* ]] || [[ $RELEASE_VERSION == 3.2* ]]; then
sed -i".tmp6" 's/__version__ = .*$/__version__ = "'"$R_NEXT_VERSION.dev0"'"/' python/pyspark/version.py
else
sed -i".tmp6" 's/__version__: str = .*$/__version__: str = "'"$R_NEXT_VERSION.dev0"'"/' python/pyspark/version.py
fi
sed -i".tmp6" 's/__version__: str = .*$/__version__: str = "'"$R_NEXT_VERSION.dev0"'"/' python/pyspark/version.py

# Update docs with next version
sed -i".tmp7" 's/SPARK_VERSION:.*$/SPARK_VERSION: '"$NEXT_VERSION"'/g' docs/_config.yml
Expand Down

0 comments on commit a5ea884

Please sign in to comment.