This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-python.git
The following commit(s) were added to refs/heads/main by this push:
new 03400e7 [tool] Shell tool for building source distribution package
(#32)
03400e7 is described below
commit 03400e7d747f0517ec5035dff4b7837dec0f19c5
Author: yuzelin <[email protected]>
AuthorDate: Mon Dec 2 21:07:37 2024 +0800
[tool] Shell tool for building source distribution package (#32)
---
README.md | 10 ++++++++
dev/build-source-distribution-package.sh | 43 ++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+)
diff --git a/README.md b/README.md
index 63c2d41..7955fa2 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,16 @@ We provide script to check codes.
./dev/lint-python.sh -h # run this to see more usages
```
+## Build
+
+We provide a script to build source distribution package.
+
+```shell
+./dev/build-source-distribution-package.sh
+```
+
+The package is under `dist/`.
+
# Usage
See Apache Paimon Python API
[Doc](https://paimon.apache.org/docs/master/program-api/python-api/).
diff --git a/dev/build-source-distribution-package.sh
b/dev/build-source-distribution-package.sh
new file mode 100755
index 0000000..461a52f
--- /dev/null
+++ b/dev/build-source-distribution-package.sh
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+CURR_DIR=`pwd`
+BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+PROJECT_ROOT="${BASE_DIR}/../"
+
+# prepare bridge jar
+
+DEPS_DIR=${PROJECT_ROOT}/deps/jars
+rm -rf ${DEPS_DIR}
+mkdir -p ${DEPS_DIR}
+
+cd ${PROJECT_ROOT}/paimon-python-java-bridge
+
+# get bridge jar version
+JAR_VERSION=$(sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' pom.xml | head -n
1)
+
+mvn clean install -DskipTests
+cp "target/paimon-python-java-bridge-${JAR_VERSION}.jar" ${DEPS_DIR}
+
+cd ${CURR_DIR}
+
+# build source distribution package
+
+python setup.py sdist
+
+rm -rf ${DEPS_DIR}
+cd ${CURR_DIR}