This is an automated email from the ASF dual-hosted git repository. dianfu pushed a commit to branch release-1.18 in repository https://gitbox.apache.org/repos/asf/flink.git
commit 1f7796ee50cfbea4fb633692e6be01070ed45c6f Author: Deepyaman Datta <[email protected]> AuthorDate: Thu Aug 3 13:17:41 2023 -0700 [FLINK-32758][python] Remove PyFlink dependencies' upper bounds This closes #23141. --- flink-python/README.md | 4 ++-- flink-python/dev/dev-requirements.txt | 24 ++++++++++++------------ flink-python/pyflink/gen_protos.py | 8 ++++---- flink-python/pyflink/table/table_environment.py | 2 +- flink-python/pyproject.toml | 8 ++++---- flink-python/setup.py | 17 +++++++++-------- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/flink-python/README.md b/flink-python/README.md index cef32b27c82..6223a97ecff 100644 --- a/flink-python/README.md +++ b/flink-python/README.md @@ -26,7 +26,7 @@ The auto-generated Python docs can be found at [https://nightlies.apache.org/fli ## Python Requirements -Apache Flink Python API depends on Py4J (currently version 0.10.9.7), CloudPickle (currently version 2.2.0), python-dateutil(currently version >=2.8.0,<3), Apache Beam (currently version 2.43.0). +Apache Flink Python API depends on Py4J (currently version 0.10.9.7), CloudPickle (currently version 2.2.0), python-dateutil (currently version >=2.8.0,<3), Apache Beam (currently version >=2.43.0,<2.49.0). ## Development Notices @@ -39,7 +39,7 @@ python pyflink/gen_protos.py ``` PyFlink depends on the following libraries to execute the above script: -1. grpcio-tools (>=1.29.0,<=1.46.3) +1. grpcio-tools (>=1.29.0,<=1.48.2) 2. setuptools (>=37.0.0) 3. pip (>=20.3) diff --git a/flink-python/dev/dev-requirements.txt b/flink-python/dev/dev-requirements.txt index f36142c0fb2..a05421acc53 100755 --- a/flink-python/dev/dev-requirements.txt +++ b/flink-python/dev/dev-requirements.txt @@ -15,20 +15,20 @@ pip>=20.3 setuptools>=18.0 wheel -apache-beam==2.43.0 -cython==0.29.24 +apache-beam>=2.43.0,<2.49.0 +cython>=0.29.24,<3 py4j==0.10.9.7 python-dateutil>=2.8.0,<3 -cloudpickle==2.2.0 -avro-python3>=1.8.1,!=1.9.2,<1.10.0 -pandas>=1.3.0,<1.4.0 -pyarrow>=5.0.0,<9.0.0 +cloudpickle~=2.2.0 +avro-python3>=1.8.1,!=1.9.2 +pandas>=1.3.0 +pyarrow>=5.0.0 pytz>=2018.3 -numpy>=1.21.4,<1.22.0 -fastavro>=1.1.0,<1.4.8 -grpcio>=1.29.0,<=1.46.3 -grpcio-tools>=1.29.0,<=1.46.3 +numpy>=1.21.4 +fastavro>=1.1.0 +grpcio>=1.29.0,<=1.48.2 +grpcio-tools>=1.29.0,<=1.48.2 pemja==0.3.0; platform_system != 'Windows' -httplib2>=0.19.0,<=0.20.4 -protobuf>=3.19.0,<=3.21 +httplib2>=0.19.0 +protobuf>=3.19.0 pytest~=7.0 diff --git a/flink-python/pyflink/gen_protos.py b/flink-python/pyflink/gen_protos.py index c87740195ad..2d926f6e448 100644 --- a/flink-python/pyflink/gen_protos.py +++ b/flink-python/pyflink/gen_protos.py @@ -32,7 +32,7 @@ import warnings import pkg_resources -GRPC_TOOLS = 'grpcio-tools>=1.29.0,<=1.46.3' +GRPC_TOOLS = 'grpcio-tools>=1.29.0,<=1.48.2' PROTO_PATHS = ['proto'] PYFLINK_ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) DEFAULT_PYTHON_OUTPUT_PATH = os.path.join(PYFLINK_ROOT_PATH, 'fn_execution') @@ -73,7 +73,7 @@ def generate_proto_files(force=True, output_dir=DEFAULT_PYTHON_OUTPUT_PATH): raise RuntimeError( 'Cannot generate protos for Windows since grpcio-tools package is ' 'not installed. Please install this package manually ' - 'using \'pip install "grpcio-tools>=1.29.0,<=1.46.3"\'.') + 'using \'pip install "grpcio-tools>=1.29.0,<=1.48.2"\'.') # Use a subprocess to avoid messing with this process' path and imports. # Note that this requires a separate module from setup.py for Windows: @@ -186,9 +186,9 @@ def _add_license_header(dir, file_name): def _check_grpcio_tools_version(): version = pkg_resources.get_distribution("grpcio-tools").parsed_version from pkg_resources import parse_version - if version < parse_version('1.29.0') or version > parse_version('1.46.3'): + if version < parse_version('1.29.0') or version > parse_version('1.48.2'): raise RuntimeError( - "Version of grpcio-tools must be between 1.29.0 and 1.46.3, got %s" % version) + "Version of grpcio-tools must be between 1.29.0 and 1.48.2, got %s" % version) if __name__ == '__main__': diff --git a/flink-python/pyflink/table/table_environment.py b/flink-python/pyflink/table/table_environment.py index a5ec177acc5..3327261ac41 100644 --- a/flink-python/pyflink/table/table_environment.py +++ b/flink-python/pyflink/table/table_environment.py @@ -1515,7 +1515,7 @@ class TableEnvironment(object): pytz.timezone(self.get_config().get_local_timezone())) step = -(-len(pdf) // splits_num) pdf_slices = [pdf.iloc[start:start + step] for start in range(0, len(pdf), step)] - data = [[c for (_, c) in pdf_slice.iteritems()] for pdf_slice in pdf_slices] + data = [[c for (_, c) in pdf_slice.items()] for pdf_slice in pdf_slices] try: with temp_file: serializer.serialize(data, temp_file) diff --git a/flink-python/pyproject.toml b/flink-python/pyproject.toml index dfe21251062..db80347e262 100644 --- a/flink-python/pyproject.toml +++ b/flink-python/pyproject.toml @@ -18,12 +18,12 @@ [build-system] # Minimum requirements for the build system to execute. requires = [ - "packaging==20.5; platform_machine=='arm64'", # macos M1 + "packaging>=20.5; platform_machine=='arm64'", # macos M1 "setuptools>=18.0", "wheel", - "apache-beam==2.43.0", - "cython==0.29.24", - "fastavro>=1.1.0,<1.4.8" + "apache-beam>=2.43.0,<2.49.0", + "cython>=0.29.24,<3", + "fastavro>=1.1.0" ] [tool.cibuildwheel] diff --git a/flink-python/setup.py b/flink-python/setup.py index 893127d232e..91b1e454f93 100644 --- a/flink-python/setup.py +++ b/flink-python/setup.py @@ -305,15 +305,16 @@ try: 'pyflink.examples': ['*.py', '*/*.py'], 'pyflink.bin': ['*']} - install_requires = ['py4j==0.10.9.7', 'python-dateutil>=2.8.0,<3', 'apache-beam==2.43.0', - 'cloudpickle==2.2.0', 'avro-python3>=1.8.1,!=1.9.2,<1.10.0', - 'pytz>=2018.3', 'fastavro>=1.1.0,<1.4.8', 'requests>=2.26.0', - 'protobuf>=3.19.0,<=3.21', - 'numpy>=1.21.4,<1.22.0', - 'pandas>=1.3.0,<1.4.0', - 'pyarrow>=5.0.0,<9.0.0', + install_requires = ['py4j==0.10.9.7', 'python-dateutil>=2.8.0,<3', + 'apache-beam>=2.43.0,<2.49.0', + 'cloudpickle>=2.2.0', 'avro-python3>=1.8.1,!=1.9.2', + 'pytz>=2018.3', 'fastavro>=1.1.0', 'requests>=2.26.0', + 'protobuf>=3.19.0', + 'numpy>=1.21.4', + 'pandas>=1.3.0', + 'pyarrow>=5.0.0', 'pemja==0.3.0;platform_system != "Windows"', - 'httplib2>=0.19.0,<=0.20.4', apache_flink_libraries_dependency] + 'httplib2>=0.19.0', apache_flink_libraries_dependency] setup( name='apache-flink',
