From 098d5e2099563afe70deb28b4c9893a65988def3 Mon Sep 17 00:00:00 2001 From: Wei Zhong Date: Thu, 24 Oct 2019 14:51:50 +0800 Subject: [PATCH] [FLINK-14509][python] Improve the README.md in flink-python to prepare for PyPI release. PyFlink will be released on PyPi from FLINK 1.10.0. This commit adds corresponding document for it. This closes #9982. --- docs/tutorials/python_table_api.md | 3 +- docs/tutorials/python_table_api.zh.md | 4 +-- flink-python/README.md | 42 +++++++++++++-------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/docs/tutorials/python_table_api.md b/docs/tutorials/python_table_api.md index 89d339716d5..f882830df57 100644 --- a/docs/tutorials/python_table_api.md +++ b/docs/tutorials/python_table_api.md @@ -32,7 +32,8 @@ to running a Python Table API program. ## Setting up a Python Project Firstly, you can fire up your favorite IDE and create a Python project and then -you need to install the PyFlink package. Please +you need to install the PyFlink package. You can install the latest PyFlink from PyPI via +this command: `pip install apache-flink`. If you want to build and install PyFlink from source code, please see [Build PyFlink]({{ site.baseurl }}/flinkDev/building.html#build-pyflink) for more details about this. diff --git a/docs/tutorials/python_table_api.zh.md b/docs/tutorials/python_table_api.zh.md index bab36e16960..6ba3b37e210 100644 --- a/docs/tutorials/python_table_api.zh.md +++ b/docs/tutorials/python_table_api.zh.md @@ -30,8 +30,8 @@ under the License. ## 创建一个Python Table API项目 -首先,你可以使用你最熟悉的IDE,创建一个Python项目。然后,你需要安装PyFlink包, -请参考[构建PyFlink]({{ site.baseurl }}/zh/flinkDev/building.html#build-pyflink)了解详细信息。 +首先,使用您最熟悉的IDE创建一个Python项目。之后执行命令`pip install apache-flink`从PyPI下载安装PyFlink包。 +如果您想从源码安装,请参考[构建PyFlink]({{ site.baseurl }}/zh/flinkDev/building.html#build-pyflink)了解详细信息。 ## 编写一个Flink Python Table API程序 diff --git a/flink-python/README.md b/flink-python/README.md index 29dc3c419fb..cb97357b59c 100644 --- a/flink-python/README.md +++ b/flink-python/README.md @@ -1,37 +1,28 @@ -# Apache Flink Python API +# Apache Flink -Apache Flink is an open source stream processing framework with the powerful stream- and batch-processing capabilities. +Apache Flink is a framework and distributed processing engine for stateful computations over unbounded and bounded data streams. Flink has been designed to run in all common cluster environments, perform computations at in-memory speed and at any scale. Learn more about Flink at [https://flink.apache.org/](https://flink.apache.org/) -This packaging allows you to write Flink programs in Python, but it is currently a very initial version and will change in future versions. - -In this initial version only Table API is supported, you can find the documentation at [https://ci.apache.org/projects/flink/flink-docs-master/dev/table/tableApi.html](https://ci.apache.org/projects/flink/flink-docs-master/dev/table/tableApi.html) +## Python Packaging -## Installation +This packaging allows you to write Flink programs in Python, but it is currently a very initial version and will change in future versions. -Currently, we can install PyFlink from Flink source code. Enter the directory where this README.md file is located and install PyFlink on your device by executing +In this initial version only Table API is supported, you can find the documentation at [https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/tableApi.html](https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/tableApi.html) -``` -python setup.py install -``` +The tutorial can be found at [https://ci.apache.org/projects/flink/flink-docs-stable/tutorials/python_table_api.html](https://ci.apache.org/projects/flink/flink-docs-stable/tutorials/python_table_api.html) -## Running test cases - -Currently, we use conda and tox to verify the compatibility of the Flink Python API for multiple versions of Python and will integrate some useful plugins with tox, such as flake8. -We can enter the directory where this README.md file is located and run test cases by executing - -``` -./dev/lint-python.sh -``` +The auto-generated Python docs can be found at [https://ci.apache.org/projects/flink/flink-docs-stable/api/python/](https://ci.apache.org/projects/flink/flink-docs-stable/api/python/) ## Python Requirements -PyFlink depends on Py4J (currently version 0.10.8.1) and CloudPickle (currently version 1.2.2). +Apache Flink Python API depends on Py4J (currently version 0.10.8.1), CloudPickle (currently version 1.2.2), python-dateutil(currently version 2.8.0) and Apache Beam (currently version 2.15.0). + +## Development Notices -## Development notices +### Protobuf Code Generation -Protocol buffer is used in this module and file `flink_fn_execution_pb2.py` is generated from `flink-fn-execution.proto`. Whenever `flink-fn-execution.proto` is updated, please re-generate `flink_fn_execution_pb2.py` by executing +Protocol buffer is used in file `flink_fn_execution_pb2.py` and the file is generated from `flink-fn-execution.proto`. Whenever `flink-fn-execution.proto` is updated, please re-generate `flink_fn_execution_pb2.py` by executing: ``` python pyflink/gen_protos.py @@ -41,3 +32,12 @@ PyFlink depends on the following libraries to execute the above script: 1. grpcio-tools (>=1.3.5,<=1.14.2) 2. setuptools (>=37.0.0) 3. pip (>=7.1.0) + +### Running Test Cases + +Currently, we use conda and tox to verify the compatibility of the Flink Python API for multiple versions of Python and will integrate some useful plugins with tox, such as flake8. +We can enter the directory where this README.md file is located and run test cases by executing + +``` +./dev/lint-python.sh +```