Skip to content

Commit

Permalink
[Rename] Rename module and package to pypaimon
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzelin committed Nov 26, 2024
1 parent 03108ec commit d6fc984
Show file tree
Hide file tree
Showing 47 changed files with 56 additions and 51 deletions.
9 changes: 7 additions & 2 deletions setup_utils/__init__.py → pypaimon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# 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',

"""This module only contains utils for setup and won't be packaged."""
]
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
6 changes: 3 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,9 @@
################################################################################

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
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,18 @@
# 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 @@ -22,7 +22,6 @@

from xml.etree import ElementTree

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

Expand Down Expand Up @@ -81,5 +80,4 @@ def _extract_bridge_version():

def _find_java_impl_dir():
this_dir = os.path.abspath(os.path.dirname(__file__))
paimon_python_dir = os.path.dirname(this_dir)
return os.path.join(paimon_python_dir, _JAVA_IMPL_MODULE)
return os.path.dirname(this_dir)
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
File renamed without changes.
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import fnmatch
import os
import shutil
import setup_utils.java_setuputils as java_setuputils
import setup_utils.version

from pypaimon.version import __version__ as version
from pypaimon.py4j.util import java_setuputils
from setuptools import Command, setup


Expand Down 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,8 +73,8 @@ def run(self):
[Doc](https://paimon.apache.org/docs/master/program-api/python-api/) for usage.'

setup(
name='paimon_python',
version=setup_utils.version.__version__,
name='pypaimon',
version=version,
packages=PACKAGES,
include_package_data=True,
package_data=PACKAGE_DATA,
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
4 changes: 2 additions & 2 deletions tools/releasing/update_branch_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set -o nounset
CURR_DIR=`pwd`
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
PROJECT_ROOT="${BASE_DIR}/../../"
SETUP_UTILS_DIR="${PROJECT_ROOT}/setup_utils"
PYPAIMON_DIR="${PROJECT_ROOT}/pypaimon"

# Sanity check to ensure that resolved paths are valid; a LICENSE file should always exist in project root
if [ ! -f ${PROJECT_ROOT}/LICENSE ]; then
Expand All @@ -44,7 +44,7 @@ fi

###########################

cd ${SETUP_UTILS_DIR}/
cd ${PYPAIMON_DIR}/

# change version
perl -pi -e "s#^__version__ = \".*\"#__version__ = \"${NEW_VERSION}\"#" version.py
Expand Down

0 comments on commit d6fc984

Please sign in to comment.