From 171524fec9adc35dd4e696878e26f56c416b7784 Mon Sep 17 00:00:00 2001 From: Gabor Somogyi Date: Mon, 28 Aug 2023 16:06:30 +0200 Subject: [PATCH] [FLINK-32971][python] Add proper development version support in pyflink --- .gitignore | 4 ++-- flink-python/apache-flink-libraries/setup.py | 3 ++- flink-python/setup.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 631daa124f2..a6875abb09e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,8 +43,8 @@ flink-python/dev/.conda/ flink-python/dev/log/ flink-python/dev/.stage.txt flink-python/.eggs/ -flink-python/apache-flink-*.dev0/ -flink-python/apache-flink-libraries/apache_flink_libraries-*.dev0/ +flink-python/apache-flink-*.dev*/ +flink-python/apache-flink-libraries/apache_flink_libraries-*.dev*/ flink-python/**/*.c flink-python/.idea/ flink-python/**/*.so diff --git a/flink-python/apache-flink-libraries/setup.py b/flink-python/apache-flink-libraries/setup.py index 668749a3545..6fdebc296fd 100644 --- a/flink-python/apache-flink-libraries/setup.py +++ b/flink-python/apache-flink-libraries/setup.py @@ -21,6 +21,7 @@ import glob import io import os import platform +import re import subprocess import sys from shutil import copytree, copy, rmtree @@ -97,7 +98,7 @@ try: print("Temp path for symlink to parent already exists {0}".format(TEMP_PATH), file=sys.stderr) sys.exit(-1) - flink_version = VERSION.replace(".dev0", "-SNAPSHOT") + flink_version = re.sub("[.]dev.*", "-SNAPSHOT", VERSION) FLINK_HOME = os.path.abspath( "../../flink-dist/target/flink-%s-bin/flink-%s" % (flink_version, flink_version)) diff --git a/flink-python/setup.py b/flink-python/setup.py index 91b1e454f93..6d113637db4 100644 --- a/flink-python/setup.py +++ b/flink-python/setup.py @@ -20,6 +20,7 @@ from __future__ import print_function import io import os import platform +import re import sys from distutils.command.build_ext import build_ext from shutil import copytree, copy, rmtree @@ -206,7 +207,7 @@ try: print("Temp path for symlink to parent already exists {0}".format(TEMP_PATH), file=sys.stderr) sys.exit(-1) - flink_version = VERSION.replace(".dev0", "-SNAPSHOT") + flink_version = re.sub("[.]dev.*", "-SNAPSHOT", VERSION) FLINK_HOME = os.path.abspath( "../flink-dist/target/flink-%s-bin/flink-%s" % (flink_version, flink_version)) FLINK_ROOT = os.path.abspath("..") @@ -252,7 +253,7 @@ try: "is complete, or do this in the flink-python directory of the flink source " "directory.") sys.exit(-1) - if VERSION.find('dev0') != -1: + if re.search('dev.*$', VERSION) is not None: apache_flink_libraries_dependency = 'apache-flink-libraries==%s' % VERSION else: split_versions = VERSION.split('.')