Skip to content

[tool] Convenient shell tool for building source distribution package #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
43 changes: 43 additions & 0 deletions dev/build-source-distribution-package.sh
Original file line number Diff line number Diff line change
@@ -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}