feluelle commented on code in PR #31253:
URL: https://github.com/apache/airflow/pull/31253#discussion_r1192554726


##########
clients/gen/common.sh:
##########
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-OPENAPI_GENERATOR_CLI_VER=5.4.0
+OPENAPI_GENERATOR_CLI_VER=6.6.0

Review Comment:
   We might want to do that in a separate PR which this one would depend on.



##########
clients/gen/python.sh:
##########
@@ -26,7 +26,7 @@ readonly CLEANUP_DIRS
 # shellcheck source=./clients/gen/common.sh
 source "${CLIENTS_GEN_DIR}/common.sh"
 
-VERSION=2.5.1
+VERSION=2.6.0

Review Comment:
   Does this need its own PR? Also, does that mean we need to regenerate the 
python client? That should have been set when we were releasing the 2.6.0 
client.



##########
clients/gen/python-nextgen.sh:
##########
@@ -0,0 +1,65 @@
+#!/bin/bash
+set -ueo pipefail
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, 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.
+
+CLIENTS_GEN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && 
pwd )"
+readonly CLIENTS_GEN_DIR
+
+CLEANUP_DIRS=(client docs test README.md)
+readonly CLEANUP_DIRS
+
+# shellcheck source=./clients/gen/common.sh
+source "${CLIENTS_GEN_DIR}/common.sh"
+
+VERSION=2.6.0
+readonly VERSION
+
+python_config=(
+    "packageVersion=${VERSION}"
+)
+
+validate_input "$@"
+
+gen_client python-nextgen \
+    --package-name client \
+    --git-repo-id airflow-client-python-nextgen \
+    --additional-properties "${python_config[*]}"
+
+echo "--- Patching generated code..."
+
+# Post-processing of the generated Python wrapper.
+
+INPLACE_ARG=("-i")
+if [[ "$OSTYPE" == "darwin"* ]]; then
+    INPLACE_ARG=(-i '')
+fi
+
+touch "${OUTPUT_DIR}/__init__.py"
+find "${OUTPUT_DIR}/test" -type f -name \*.py -exec sed "${INPLACE_ARG[@]}" -e 
's/client/airflow_client.client/g' {} +
+find "${OUTPUT_DIR}" -type f -a -name \*.md -exec sed "${INPLACE_ARG[@]}" -e 
's/# client/# Apache Airflow Python Client/g' {} +
+find "${OUTPUT_DIR}" -type f -a -name \*.md -exec sed "${INPLACE_ARG[@]}" -e 
's/import client/import airflow_client.client/g' {} +
+find "${OUTPUT_DIR}" -type f -a -name \*.md -exec sed "${INPLACE_ARG[@]}" -e 
's/from client/from airflow_client.client/g' {} +
+find "${OUTPUT_DIR}" -type f -a -name \*.md -exec sed "${INPLACE_ARG[@]}" -e 
's/getattr(client\.models/getattr(airflow_client.client.models/g' {} +
+
+# fix imports
+find "${OUTPUT_DIR}/client/" -type f -name \*.py -exec sed "${INPLACE_ARG[@]}" 
-e 's/import client\./import airflow_client.client./g' {} +
+find "${OUTPUT_DIR}/client/" -type f -name \*.py -exec sed "${INPLACE_ARG[@]}" 
-e 's/from client/from airflow_client.client/g' {} +
+find "${OUTPUT_DIR}/client/" -type f -name \*.py -exec sed "${INPLACE_ARG[@]}" 
-e 's/getattr(client\.models/getattr(airflow_client.client.models/g' {} +

Review Comment:
   Do we really need that?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to