From 7aa03a50475b889b5159a45fd58817edd2b07854 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Sun, 25 Jun 2023 10:32:02 +0800 Subject: [PATCH 1/5] Init --- build_scripts/windows/scripts/build.cmd | 2 +- scripts/release/debian/Dockerfile | 2 +- scripts/release/debian/build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build_scripts/windows/scripts/build.cmd b/build_scripts/windows/scripts/build.cmd index 3944e96b925..3809dfcac8d 100644 --- a/build_scripts/windows/scripts/build.cmd +++ b/build_scripts/windows/scripts/build.cmd @@ -13,7 +13,7 @@ if "%CLI_VERSION%"=="" ( echo Please set the CLI_VERSION environment variable, e.g. 2.0.13 goto ERROR ) -set PYTHON_VERSION=3.10.10 +set PYTHON_VERSION=3.10.12 set WIX_DOWNLOAD_URL="https://azurecliprod.blob.core.windows.net/msi/wix310-binaries-mirror.zip" set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-win32.zip" diff --git a/scripts/release/debian/Dockerfile b/scripts/release/debian/Dockerfile index 11f4eaafdc1..a8539df2fb3 100644 --- a/scripts/release/debian/Dockerfile +++ b/scripts/release/debian/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update RUN apt-get install -y libssl-dev libffi-dev python3-dev debhelper zlib1g-dev wget # Download Python source code -ARG python_version="3.10.10" +ARG python_version="3.10.12" ENV PYTHON_SRC_DIR=/usr/src/python RUN mkdir -p ${PYTHON_SRC_DIR} && \ wget -qO- https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tgz \ diff --git a/scripts/release/debian/build.sh b/scripts/release/debian/build.sh index f6471251312..7faf88b78c8 100755 --- a/scripts/release/debian/build.sh +++ b/scripts/release/debian/build.sh @@ -15,7 +15,7 @@ set -exv ls -Rl /mnt/artifacts WORKDIR=`cd $(dirname $0); cd ../../../; pwd` -PYTHON_VERSION="3.10.10" +PYTHON_VERSION="3.10.12" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Update APT packages From 56577fd0f29ea3cf920747b696b54050554b5def Mon Sep 17 00:00:00 2001 From: Hang Date: Tue, 18 Jul 2023 16:31:38 +0800 Subject: [PATCH 2/5] Use 3.11.4 --- build_scripts/windows/scripts/build.cmd | 2 +- scripts/release/debian/Dockerfile | 2 +- scripts/release/debian/build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build_scripts/windows/scripts/build.cmd b/build_scripts/windows/scripts/build.cmd index 3809dfcac8d..76b0998aa89 100644 --- a/build_scripts/windows/scripts/build.cmd +++ b/build_scripts/windows/scripts/build.cmd @@ -13,7 +13,7 @@ if "%CLI_VERSION%"=="" ( echo Please set the CLI_VERSION environment variable, e.g. 2.0.13 goto ERROR ) -set PYTHON_VERSION=3.10.12 +set PYTHON_VERSION=3.11.4 set WIX_DOWNLOAD_URL="https://azurecliprod.blob.core.windows.net/msi/wix310-binaries-mirror.zip" set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-win32.zip" diff --git a/scripts/release/debian/Dockerfile b/scripts/release/debian/Dockerfile index a8539df2fb3..11f4eaafdc1 100644 --- a/scripts/release/debian/Dockerfile +++ b/scripts/release/debian/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update RUN apt-get install -y libssl-dev libffi-dev python3-dev debhelper zlib1g-dev wget # Download Python source code -ARG python_version="3.10.12" +ARG python_version="3.10.10" ENV PYTHON_SRC_DIR=/usr/src/python RUN mkdir -p ${PYTHON_SRC_DIR} && \ wget -qO- https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tgz \ diff --git a/scripts/release/debian/build.sh b/scripts/release/debian/build.sh index 7faf88b78c8..4ef2ea99481 100755 --- a/scripts/release/debian/build.sh +++ b/scripts/release/debian/build.sh @@ -15,7 +15,7 @@ set -exv ls -Rl /mnt/artifacts WORKDIR=`cd $(dirname $0); cd ../../../; pwd` -PYTHON_VERSION="3.10.12" +PYTHON_VERSION="3.11.4" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Update APT packages From ce12d6a5e255f3654d147f9c468eb2571c2c3e33 Mon Sep 17 00:00:00 2001 From: Hang Date: Tue, 15 Aug 2023 14:10:49 +0800 Subject: [PATCH 3/5] Update dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 37374bba5aa..1e25d94d0fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. #--------------------------------------------------------------------------------------------- -ARG PYTHON_VERSION="3.10" +ARG PYTHON_VERSION="3.11" FROM python:${PYTHON_VERSION}-alpine From 8ae6369ef63c2078ef0ba59f1d3bafdc6397f364 Mon Sep 17 00:00:00 2001 From: Hang Date: Tue, 15 Aug 2023 14:11:17 +0800 Subject: [PATCH 4/5] Update homebrew python version --- .../homebrew/docker/formula_generate.py | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/release/homebrew/docker/formula_generate.py b/scripts/release/homebrew/docker/formula_generate.py index 590c2229fa9..3b8a75474ba 100644 --- a/scripts/release/homebrew/docker/formula_generate.py +++ b/scripts/release/homebrew/docker/formula_generate.py @@ -15,10 +15,11 @@ import bisect import argparse -TEMPLATE_FILE_NAME='formula_template.txt' -CLI_VERSION=os.environ['CLI_VERSION'] -HOMEBREW_UPSTREAM_URL=os.environ['HOMEBREW_UPSTREAM_URL'] -HOMEBREW_FORMULAR_LATEST="https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/azure-cli.rb" +TEMPLATE_FILE_NAME = 'formula_template.txt' +CLI_VERSION = os.environ['CLI_VERSION'] +HOMEBREW_UPSTREAM_URL = os.environ['HOMEBREW_UPSTREAM_URL'] +HOMEBREW_FORMULAR_LATEST = "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/azure-cli.rb" +PYTHON_VERSION = '3.11' def main(): @@ -26,10 +27,12 @@ def main(): parser = argparse.ArgumentParser(prog='formula_generator.py') parser.set_defaults(func=generate_formula) - parser.add_argument('-b', dest='build_method', choices=['update_existing', 'use_template'], help='The build method, default is update_existing, the other option is use_template.') + parser.add_argument('-b', dest='build_method', choices=['update_existing', 'use_template'], + help='The build method, default is update_existing, the other option is use_template.') args = parser.parse_args() args.func(**vars(args)) + def generate_formula(build_method: str, **_): content = '' if build_method is None or build_method == 'update_existing': @@ -82,7 +85,8 @@ def collect_resources() -> str: def collect_resources_dict() -> dict: nodes = make_graph('azure-cli') - filtered_nodes = {nodes[node_name]['name']: nodes[node_name] for node_name in sorted(nodes) if resource_filter(node_name)} + filtered_nodes = {nodes[node_name]['name']: nodes[node_name] for node_name in sorted(nodes) if + resource_filter(node_name)} return filtered_nodes @@ -121,6 +125,10 @@ def update_formula() -> str: resp.raise_for_status() text = resp.text + # update python version + text = re.sub('depends_on "python@.*"', f'depends_on "python@{PYTHON_VERSION}"', text, 1) + text = re.sub(r'virtualenv_create\(libexec, "python.*"', f'virtualenv_create(libexec, "python{PYTHON_VERSION}"', text, 1) # pylint: disable=line-too-long + # update url and sha256 of azure-cli text = re.sub('url ".*"', 'url "{}"'.format(HOMEBREW_UPSTREAM_URL), text, 1) upstream_sha = compute_sha256(HOMEBREW_UPSTREAM_URL) @@ -148,7 +156,7 @@ def update_formula() -> str: node_index_dict[pack] = idx elif pack is not None: if line.startswith(" url"): - #update the url of package + # update the url of package if pack in nodes.keys(): url_match = re.search(r'url "(.*)"', line) if url_match is not None and nodes[pack]['url'] != url_match.group(1): @@ -157,7 +165,7 @@ def update_formula() -> str: else: packs_to_remove.add(pack) elif line.startswith(" sha256"): - #update the sha256 of package + # update the sha256 of package if pack in nodes.keys(): lines[idx] = re.sub('sha256 ".*"', 'sha256 "{}"'.format(nodes[pack]['checksum']), line, 1) del nodes[pack] From 360a525fe8038060e926c81f96645a19bc427b08 Mon Sep 17 00:00:00 2001 From: Hang Date: Fri, 25 Aug 2023 17:22:14 +0800 Subject: [PATCH 5/5] Use 3.11.5 --- build_scripts/windows/scripts/build.cmd | 2 +- scripts/release/debian/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/windows/scripts/build.cmd b/build_scripts/windows/scripts/build.cmd index dcf67911964..c1cc4859baf 100644 --- a/build_scripts/windows/scripts/build.cmd +++ b/build_scripts/windows/scripts/build.cmd @@ -25,7 +25,7 @@ if "%ARCH%"=="x86" ( echo Please set ARCH to "x86" or "x64" goto ERROR ) -set PYTHON_VERSION=3.11.4 +set PYTHON_VERSION=3.11.5 set WIX_DOWNLOAD_URL="https://azurecliprod.blob.core.windows.net/msi/wix310-binaries-mirror.zip" set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-%PYTHON_ARCH%.zip" diff --git a/scripts/release/debian/build.sh b/scripts/release/debian/build.sh index 4ef2ea99481..700917cba8d 100755 --- a/scripts/release/debian/build.sh +++ b/scripts/release/debian/build.sh @@ -15,7 +15,7 @@ set -exv ls -Rl /mnt/artifacts WORKDIR=`cd $(dirname $0); cd ../../../; pwd` -PYTHON_VERSION="3.11.4" +PYTHON_VERSION="3.11.5" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Update APT packages