Skip to content

Commit 2a31b1c

Browse files
authored
[Build] Refactor project structure and refactor release tools (#31)
1 parent 33d5253 commit 2a31b1c

38 files changed

+251
-428
lines changed

.github/workflows/check-java-bridge-licensing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
- name: Build
4141
run: |
4242
set -o pipefail
43-
cd pypaimon/py4j/paimon-python-java-bridge
43+
cd paimon-python-java-bridge
4444
mvn clean deploy ${{ env.MVN_COMMON_OPTIONS }} -DskipTests \
4545
-DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
4646
| tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
4747
4848
- name: Check licensing
4949
run: |
50-
cd pypaimon/py4j/paimon-python-java-bridge
50+
cd paimon-python-java-bridge
5151
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-licensing -N \
5252
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}" \
5353
-Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Create Source Release
17+
18+
on:
19+
workflow_dispatch:
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
29+
- name: Setup GPG
30+
env:
31+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
32+
run: |
33+
mkdir -p ~/.gnupg
34+
chmod 700 ~/.gnupg
35+
echo $GPG_PRIVATE_KEY | base64 --decode | gpg --batch --import --yes
36+
echo "use-agent" >> ~/.gnupg/gpg.conf
37+
echo "pinentry-program /usr/bin/pinentry" >> ~/.gnupg/gpg-agent.conf
38+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
39+
40+
- name: Create source release
41+
env:
42+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
43+
run: |
44+
mkdir -p output
45+
chmod +x tools/releasing/create_source_release.sh
46+
OUTPUT_DIR=output GPG_PASSPHRASE=$GPG_PASSPHRASE tools/releasing/create_source_release.sh
47+
48+
- name: Upload source release
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: source-release
52+
path: output/*

.github/workflows/paimon-python-checks.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,8 @@ jobs:
4343
with:
4444
java-version: ${{ env.JDK_VERSION }}
4545
distribution: 'adopt'
46-
- name: Set up hadoop dependency
47-
run: |
48-
mkdir -p ${{ github.workspace }}/temp
49-
curl -L -o ${{ github.workspace }}/temp/bundled-hadoop.jar \
50-
https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar
46+
5147
- name: Run lint-python.sh
52-
env:
53-
_PYPAIMON_HADOOP_CLASSPATH: ${{ github.workspace }}/temp/bundled-hadoop.jar
5448
run: |
5549
chmod +x dev/lint-python.sh
5650
./dev/lint-python.sh

MANIFEST.in

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
################################################################################
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
################################################################################
18+
19+
global-exclude *.py[cod] __pycache__ .DS_Store
20+
recursive-include deps/jars *.jar
21+
include README.md
22+
include LICENSE
23+
include NOTICE

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ We provide script to check codes.
3131
./dev/lint-python.sh -h # run this to see more usages
3232
```
3333

34-
## Build
35-
36-
We provide script to build wheel.
37-
38-
```shell
39-
./dev/build-wheels.sh
40-
```
41-
42-
The target wheel is under `dist/`
43-
4434
# Usage
4535

4636
See Apache Paimon Python API [Doc](https://paimon.apache.org/docs/master/program-api/python-api/).

dev/build-wheels.sh

Lines changed: 0 additions & 56 deletions
This file was deleted.

dev/lint-python.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,9 @@ function tox_check() {
577577
# Ensure the permission of the scripts set correctly
578578
chmod +x $PAIMON_PYTHON_DIR/dev/*
579579

580-
# tox runs codes in virtual env, set var to avoid error
581-
export _PYPAIMON_TOX_TEST="true"
580+
# dummy jar needed by setup.py
581+
mkdir -p $PAIMON_PYTHON_DIR/deps/jars
582+
touch $PAIMON_PYTHON_DIR/deps/jars/dummy.jar
582583

583584
if [[ -n "$GITHUB_ACTION" ]]; then
584585
# Run tests in all versions triggered by a Git push (tests aren't so many currently)
@@ -596,6 +597,9 @@ function tox_check() {
596597
$TOX_PATH -vv -c $PAIMON_PYTHON_DIR/tox.ini -e ${ENV_LIST[$index]} --recreate 2>&1 | tee -a $LOG_FILE
597598
fi
598599

600+
# delete dummy jar
601+
rm -rf $PAIMON_PYTHON_DIR/deps
602+
599603
TOX_RESULT=$((grep -c "congratulations :)" "$LOG_FILE") 2>&1)
600604
if [ $TOX_RESULT -eq '0' ]; then
601605
print_function "STAGE" "tox checks... [FAILED]"
41.3 MB
Binary file not shown.
41.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)