Skip to content

Commit

Permalink
[Rename] Rename module and package to pypaimon (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzelin authored Nov 26, 2024
1 parent 03108ec commit 33d5253
Show file tree
Hide file tree
Showing 48 changed files with 73 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-java-bridge-licensing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
- name: Build
run: |
set -o pipefail
cd paimon_python_java/paimon-python-java-bridge
cd pypaimon/py4j/paimon-python-java-bridge
mvn clean deploy ${{ env.MVN_COMMON_OPTIONS }} -DskipTests \
-DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
| tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
- name: Check licensing
run: |
cd paimon_python_java/paimon-python-java-bridge
cd pypaimon/py4j/paimon-python-java-bridge
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-licensing -N \
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}" \
-Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties
Expand Down
21 changes: 21 additions & 0 deletions pypaimon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
################################################################################
# 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.
#################################################################################

from .api import Schema

__all__ = ['Schema']
File renamed without changes.
2 changes: 1 addition & 1 deletion paimon_python_api/catalog.py → pypaimon/api/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from abc import ABC, abstractmethod
from typing import Optional
from paimon_python_api import Table, Schema
from pypaimon.api import Table, Schema


class Catalog(ABC):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#################################################################################

from abc import ABC, abstractmethod
from paimon_python_api import TableRead, TableScan, Predicate, PredicateBuilder
from pypaimon.api import TableRead, TableScan, Predicate, PredicateBuilder
from typing import List


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion paimon_python_api/table.py → pypaimon/api/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import pyarrow as pa

from abc import ABC, abstractmethod
from paimon_python_api import ReadBuilder, BatchWriteBuilder
from pypaimon.api import ReadBuilder, BatchWriteBuilder
from typing import Optional, List


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#################################################################################

from abc import ABC, abstractmethod
from paimon_python_api import CommitMessage
from pypaimon.api import CommitMessage
from typing import List


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from abc import ABC, abstractmethod
from duckdb.duckdb import DuckDBPyConnection
from paimon_python_api import Split
from pypaimon.api import Split
from typing import List, Optional


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from abc import ABC, abstractmethod
from typing import List
from paimon_python_api import Split
from pypaimon.api import Split


class TableScan(ABC):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pyarrow as pa

from abc import ABC, abstractmethod
from paimon_python_api import CommitMessage
from pypaimon.api import CommitMessage
from typing import List


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#################################################################################

from abc import ABC, abstractmethod
from paimon_python_api import BatchTableCommit, BatchTableWrite
from pypaimon.api import BatchTableCommit, BatchTableWrite
from typing import Optional


Expand Down
7 changes: 4 additions & 3 deletions paimon_python_java/__init__.py → pypaimon/py4j/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
################################################################################

from .util import constants
from .pypaimon import (Catalog, Table, ReadBuilder, TableScan, Plan, Split, TableRead,
BatchWriteBuilder, BatchTableWrite, CommitMessage, BatchTableCommit,
Predicate, PredicateBuilder)
from .java_implementation import \
(Catalog, Table, ReadBuilder, TableScan, Plan, Split,
TableRead, BatchWriteBuilder, BatchTableWrite, CommitMessage,
BatchTableCommit, Predicate, PredicateBuilder)

__all__ = [
'constants',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import signal

from subprocess import Popen, PIPE
from paimon_python_java import constants
from pypaimon.py4j import constants


def on_windows():
Expand Down Expand Up @@ -74,7 +74,7 @@ def preexec_func():
stdin=PIPE, stderr=PIPE, preexec_fn=preexec_fn, env=env)


_JAVA_IMPL_MODULE = 'paimon_python_java'
_JAVA_IMPL_MODULE = 'pypaimon.py4j'
_JAVA_DEPS = 'java_dependencies'
_JAVA_BRIDGE = 'paimon-python-java-bridge'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
CallbackServerParameters)
from threading import RLock

from paimon_python_java.gateway_server import launch_gateway_server_process
from paimon_python_java import constants
from paimon_python_java.util.exceptions import install_py4j_hooks
from pypaimon.py4j.gateway_server import launch_gateway_server_process
from pypaimon.py4j import constants
from pypaimon.py4j.util.exceptions import install_py4j_hooks

_gateway = None
_lock = RLock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@
# limitations under the License.
################################################################################

# pypaimon.api implementation based on Java code & py4j lib

import duckdb
import pandas as pd
import pyarrow as pa
import ray

from duckdb.duckdb import DuckDBPyConnection
from paimon_python_java.java_gateway import get_gateway
from paimon_python_java.util import java_utils, constants
from paimon_python_api import (catalog, table, read_builder, table_scan, split, table_read,
write_builder, table_write, commit_message, table_commit, Schema,
predicate)
from pypaimon.py4j.java_gateway import get_gateway
from pypaimon.py4j.util import java_utils, constants
from pypaimon.api import \
(catalog, table, read_builder, table_scan, split,
table_read, write_builder, table_write, commit_message,
table_commit, Schema, predicate)
from typing import List, Iterator, Optional, Any


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import pyarrow as pa
import unittest

from paimon_python_api import Schema
from paimon_python_java import Catalog
from paimon_python_java.tests import utils
from paimon_python_java.util import java_utils
from pypaimon import Schema
from pypaimon.py4j import Catalog
from pypaimon.py4j.tests import utils
from pypaimon.py4j.util import java_utils
from setup_utils import java_setuputils


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import pandas as pd
import pyarrow as pa

from paimon_python_api import Schema
from paimon_python_java import Catalog
from paimon_python_java.tests import utils
from pypaimon import Schema
from pypaimon.py4j import Catalog
from pypaimon.py4j.tests import utils
from setup_utils import java_setuputils


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import pyarrow as pa
from py4j.protocol import Py4JJavaError

from paimon_python_api import Schema
from paimon_python_java import Catalog
from paimon_python_java.java_gateway import get_gateway
from paimon_python_java.tests import utils
from paimon_python_java.util import java_utils
from pypaimon import Schema
from pypaimon.py4j import Catalog
from pypaimon.py4j.java_gateway import get_gateway
from pypaimon.py4j.tests import utils
from pypaimon.py4j.util import java_utils
from setup_utils import java_setuputils


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os
import urllib.request

from paimon_python_java.util import constants
from pypaimon.py4j import constants


def setup_hadoop_bundle_jar(hadoop_dir):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import pyarrow as pa

from paimon_python_api import Schema
from paimon_python_java.java_gateway import get_gateway
from pypaimon import Schema
from pypaimon.py4j.java_gateway import get_gateway


def to_j_catalog_context(catalog_options: dict):
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ def run(self):

try:
PACKAGES = [
'paimon_python_api',
'paimon_python_java',
'paimon_python_java.util'
'pypaimon',
'pypaimon.api',
'pypaimon.py4j',
'pypaimon.py4j.util'
]

PACKAGE_DATA = {
'paimon_python_java': java_setuputils.get_package_data()
'pypaimon.py4j': java_setuputils.get_package_data()
}

install_requires = [
Expand All @@ -72,7 +73,7 @@ def run(self):
[Doc](https://paimon.apache.org/docs/master/program-api/python-api/) for usage.'

setup(
name='paimon_python',
name='pypaimon',
version=setup_utils.version.__version__,
packages=PACKAGES,
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion setup_utils/java_setuputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from xml.etree import ElementTree

_JAVA_IMPL_MODULE = 'paimon_python_java'
_JAVA_IMPL_MODULE = 'pypaimon/py4j'
_JAVA_DEPS = 'java_dependencies'
_JAVA_BRIDGE = 'paimon-python-java-bridge'

Expand Down
2 changes: 1 addition & 1 deletion tools/releasing/create_binary_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ source dev/.conda/bin/activate
# build
dev/build-wheels.sh

WHEEL_FILE_NAME="paimon_python-${RELEASE_VERSION}-py3-none-any.whl"
WHEEL_FILE_NAME="pypaimon-${RELEASE_VERSION}-py3-none-any.whl"
cp "dist/${WHEEL_FILE_NAME}" "${RELEASE_DIR}/${WHEEL_FILE_NAME}"

cd ${RELEASE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion tools/releasing/create_source_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ echo "Creating source package"
git clone ${PROJECT_ROOT} ${CLONE_DIR}

cd ${CLONE_DIR}
JAVA_ROOT="paimon_python_java/paimon-python-java-bridge"
JAVA_ROOT="pypaimon/py4j/paimon-python-java-bridge"
rsync -a \
--exclude ".DS_Store" --exclude ".asf.yaml" --exclude ".git" \
--exclude ".github" --exclude ".gitignore" --exclude ".idea" \
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ max-line-length=100
exclude=.tox/*,dev/*,build/*,dist/*

[mypy]
files=paimon_python_api/*.py
files=pypaimon/api/*.py
ignore_missing_imports = True
strict_optional=False

0 comments on commit 33d5253

Please sign in to comment.