Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packaging] Bump embedded Python version to 3.11.5 #26749

Merged
merged 8 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build_scripts/windows/scripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if "%ARCH%"=="x86" (
echo Please set ARCH to "x86" or "x64"
goto ERROR
)
set PYTHON_VERSION=3.10.10
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"
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -exv
ls -Rl /mnt/artifacts

WORKDIR=`cd $(dirname $0); cd ../../../; pwd`
PYTHON_VERSION="3.10.10"
PYTHON_VERSION="3.11.5"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Update APT packages
Expand Down
5 changes: 5 additions & 0 deletions scripts/release/homebrew/docker/formula_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
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/a/azure-cli.rb"
PYTHON_VERSION = '3.11'


def main():
Expand Down Expand Up @@ -124,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

Comment on lines +128 to +131
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these lines be dropped in the next release? It is really inconvenient to make any change to the formula.

Or, can we just keep the formula as is and make the change when a PR is submitted for https://github.com/Homebrew/homebrew-core/blob/master/Formula/a/azure-cli.rb ?

In my thought, the Azure CLI repo should be self-contained - it should never depend on external resources to build and install.

Copy link
Contributor Author

@bebound bebound Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep it here for two reasons.

  1. TestHomebrewFormula can check whether new formula works with new Python.
  2. Homebrew users can use the new Python version as soon as possible.

For other changes like the without_pip: false in #27186, we can create a PR for homebrew.

Sometimes the Homebrew community update our formula, which cause a conflict, so we modify the external formula. This behavior is introduced in #11964

# 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)
Expand Down