Skip to content

Commit

Permalink
Include connector JAR in Py package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferenc Csaky committed Jan 31, 2024
1 parent 73eb156 commit fdab870
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flink-python/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ under the License.
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-cassandra_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down
10 changes: 9 additions & 1 deletion flink-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
################################################################################
from __future__ import print_function

import glob
import io
import os
import sys

from setuptools import setup
from shutil import rmtree
from shutil import copy, rmtree
from xml.etree import ElementTree as ET

PACKAGE_NAME = 'apache-flink-connector-aws'
Expand All @@ -35,6 +36,7 @@
VERSION_FILE = os.path.join(
CURRENT_DIR,
'pyflink/datastream/connectors/cassandra_connector_version.py')
LIB_PATH = os.path.join(CURRENT_DIR, 'pyflink/lib')
DEPENDENCY_FILE = os.path.join(CURRENT_DIR, 'dev/dev-requirements.txt')


Expand Down Expand Up @@ -82,6 +84,11 @@ def prepare_pyflink_dir():

flink_dependency = "apache-flink>=" + flink_version

os.makedirs(LIB_PATH)
connector_jar = \
glob.glob(CURRENT_DIR + '/target/test-dependencies/flink-connector-cassandra*.jar')[0]
copy(connector_jar, LIB_PATH)

with io.open(VERSION_FILE, 'w', encoding='utf-8') as f:
f.write('# Generated file, do not edit\n')
f.write('__connector_version__ = "' + connector_version + '"\n')
Expand Down Expand Up @@ -111,6 +118,7 @@ def prepare_pyflink_dir():
if in_flink_source:
remove_if_exists(VERSION_FILE)
remove_if_exists(DEPENDENCY_FILE)
remove_if_exists(LIB_PATH)
prepare_pyflink_dir()
print("\nPreparing Flink Cassandra connector package")

Expand Down

0 comments on commit fdab870

Please sign in to comment.