From 06ef1601dca3f9be3ebf7ebcb720ad070bd20cef Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Wed, 16 Oct 2024 16:45:52 +0800 Subject: [PATCH] Clean up --- azure-pipelines.yml | 271 ------------------------ build_scripts/windows/scripts/build.cmd | 11 +- 2 files changed, 2 insertions(+), 280 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4ad5f8155ae..f16d37e4a39 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -233,277 +233,6 @@ jobs: TargetPath: 'build_scripts/windows/out/' ArtifactName: msi-$(Platform) -- job: Test127Official - displayName: Test 3.12.7 official - pool: - vmImage: windows-2019 - steps: - - script: | - echo default python - where python3 - python3 --version - python3 -m pip debug - - set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" - - set PYTHON_ARCH=amd64 - set PYTHON_VERSION=3.12.7 - - - set REPO_ROOT=%CD% - - set PYTHON_DIR=%REPO_ROOT%\artifacts\Python - - rm -rf %PYTHON_DIR% - - set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-%PYTHON_ARCH%.zip" - - echo %PYTHON_DOWNLOAD_URL% - - REM https://pip.pypa.io/en/stable/installation/#get-pip-py - set GET_PIP_DOWNLOAD_URL="https://bootstrap.pypa.io/get-pip.py" - - echo Setting up Python and pip - mkdir %PYTHON_DIR% - pushd %PYTHON_DIR% - - echo Downloading Python - curl --output python-archive.zip %PYTHON_DOWNLOAD_URL% - unzip python-archive.zip - del python-archive.zip - echo Python downloaded and extracted successfully - - REM Delete _pth file so that Lib\site-packages is included in sys.path - REM https://github.com/pypa/pip/issues/4207#issuecomment-297396913 - REM https://docs.python.org/3.10/using/windows.html#finding-modules - del python*._pth - - echo Installing pip - curl --output get-pip.py %GET_PIP_DOWNLOAD_URL% - echo %PYTHON_DIR%\python.exe - - %PYTHON_DIR%\python.exe get-pip.py - del get-pip.py - echo Pip set up successful - echo python.exe -m site - %PYTHON_DIR%\python.exe -m site - echo %errorlevel% - echo python.exe -Im site - %PYTHON_DIR%\python.exe -Im site - echo %errorlevel% - - echo python.exe -Im pip debug - %PYTHON_DIR%\python.exe -Im pip debug - echo %errorlevel% - echo -Ic pip - %PYTHON_DIR%\python.exe -Ic "import pip;print(pip.__path__)" - echo %errorlevel% - echo -c pip - %PYTHON_DIR%\python.exe -c "import pip;print(pip.__path__)" - echo %errorlevel% - echo python.exe -m pip debug - %PYTHON_DIR%\python.exe -m pip debug - echo %errorlevel% - - - echo install src - set CLI_SRC=%REPO_ROOT%\src - for %%a in (%CLI_SRC%\azure-cli %CLI_SRC%\azure-cli-core %CLI_SRC%\azure-cli-telemetry) do ( - pushd %%a - %PYTHON_DIR%\python.exe -Im pip install --no-warn-script-location --no-cache-dir --no-deps . -vvv - popd - ) - - - echo dir 3.12.7 - dir C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib - dir C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\site-packages - echo dir 3.12.6 - dir C:\hostedtoolcache\windows\Python\3.12.6\x64\Lib - dir C:\hostedtoolcache\windows\Python\3.12.6\x64\Lib\site-packages - -- job: Test127 - displayName: Test 3.12.7 - pool: - name: ${{ variables.windows_pool }} - steps: - - script: | - echo default python - where python3 - python3 --version - python3 -m pip debug - python --version - python -m pip debug - set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" - - set PYTHON_ARCH=amd64 - set PYTHON_VERSION=3.12.7 - - - set REPO_ROOT=%CD% - - set PYTHON_DIR=%REPO_ROOT%\artifacts\Python - - rm -rf %PYTHON_DIR% - - set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-%PYTHON_ARCH%.zip" - - echo %PYTHON_DOWNLOAD_URL% - - REM https://pip.pypa.io/en/stable/installation/#get-pip-py - set GET_PIP_DOWNLOAD_URL="https://bootstrap.pypa.io/get-pip.py" - - echo Setting up Python and pip - mkdir %PYTHON_DIR% - pushd %PYTHON_DIR% - - echo Downloading Python - curl --output python-archive.zip %PYTHON_DOWNLOAD_URL% - unzip python-archive.zip - del python-archive.zip - echo Python downloaded and extracted successfully - - REM Delete _pth file so that Lib\site-packages is included in sys.path - REM https://github.com/pypa/pip/issues/4207#issuecomment-297396913 - REM https://docs.python.org/3.10/using/windows.html#finding-modules - del python*._pth - - echo Installing pip - curl --output get-pip.py %GET_PIP_DOWNLOAD_URL% - echo %PYTHON_DIR%\python.exe - - %PYTHON_DIR%\python.exe get-pip.py - del get-pip.py - echo Pip set up successful - echo python.exe -m site - %PYTHON_DIR%\python.exe -m site - echo %errorlevel% - echo python.exe -Im site - %PYTHON_DIR%\python.exe -Im site - echo %errorlevel% - - echo install setuptools wheel - %PYTHON_DIR%\python.exe -Im pip install setuptools wheel - - echo python.exe -Im pip debug - %PYTHON_DIR%\python.exe -Im pip debug - echo %errorlevel% - echo -Ic pip - %PYTHON_DIR%\python.exe -Ic "import pip;print(pip.__path__)" - echo %errorlevel% - echo -c pip - %PYTHON_DIR%\python.exe -c "import pip;print(pip.__path__)" - echo %errorlevel% - echo python.exe -m pip debug - %PYTHON_DIR%\python.exe -m pip debug - echo %errorlevel% - - echo install src - set CLI_SRC=%REPO_ROOT%\src - for %%a in (%CLI_SRC%\azure-cli %CLI_SRC%\azure-cli-core %CLI_SRC%\azure-cli-telemetry) do ( - pushd %%a - %PYTHON_DIR%\python.exe -Im pip install --no-warn-script-location --no-cache-dir --no-deps . -vvv - popd - ) - - - echo dir 3.12.7 - dir C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib - dir C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\site-packages - echo dir 3.12.6 - dir C:\hostedtoolcache\windows\Python\3.12.6\x64\Lib - dir C:\hostedtoolcache\windows\Python\3.12.6\x64\Lib\site-packages - -- job: Test126 - displayName: Test 3.12.6 - pool: - name: ${{ variables.windows_pool }} - steps: - - script: | - echo default python - where python3 - python3 --version - python3 -m pip debug - - - set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" - - - set PYTHON_ARCH=amd64 - set PYTHON_VERSION=3.12.6 - - - set REPO_ROOT=%CD% - - set PYTHON_DIR=%REPO_ROOT%\artifacts\Python - - rm -rf %PYTHON_DIR% - - set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-%PYTHON_ARCH%.zip" - - echo %PYTHON_DOWNLOAD_URL% - - REM https://pip.pypa.io/en/stable/installation/#get-pip-py - set GET_PIP_DOWNLOAD_URL="https://bootstrap.pypa.io/get-pip.py" - - echo Setting up Python and pip - mkdir %PYTHON_DIR% - pushd %PYTHON_DIR% - - echo Downloading Python - curl --output python-archive.zip %PYTHON_DOWNLOAD_URL% - unzip python-archive.zip - del python-archive.zip - echo Python downloaded and extracted successfully - - REM Delete _pth file so that Lib\site-packages is included in sys.path - REM https://github.com/pypa/pip/issues/4207#issuecomment-297396913 - REM https://docs.python.org/3.10/using/windows.html#finding-modules - del python*._pth - - echo Installing pip - curl --output get-pip.py %GET_PIP_DOWNLOAD_URL% - echo %PYTHON_DIR%\python.exe - - %PYTHON_DIR%\python.exe get-pip.py - del get-pip.py - echo Pip set up successful - echo python.exe -m site - %PYTHON_DIR%\python.exe -m site - echo %errorlevel% - echo python.exe -Im site - %PYTHON_DIR%\python.exe -Im site - echo %errorlevel% - - echo python.exe -Im pip debug - %PYTHON_DIR%\python.exe -Im pip debug - echo %errorlevel% - echo -Ic pip - %PYTHON_DIR%\python.exe -Ic "import pip;print(pip.__path__)" - echo %errorlevel% - echo -c pip - %PYTHON_DIR%\python.exe -c "import pip;print(pip.__path__)" - echo %errorlevel% - echo python.exe -m pip debug - %PYTHON_DIR%\python.exe -m pip debug - echo %errorlevel% - - - echo install src - set CLI_SRC=%REPO_ROOT%\src - for %%a in (%CLI_SRC%\azure-cli %CLI_SRC%\azure-cli-core %CLI_SRC%\azure-cli-telemetry) do ( - pushd %%a - %PYTHON_DIR%\python.exe -Im pip install --no-warn-script-location --no-cache-dir --no-deps . -vvv - popd - ) - - echo dir 3.12.7 - dir C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib - dir C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\site-packages - echo dir 3.12.6 - dir C:\hostedtoolcache\windows\Python\3.12.6\x64\Lib - dir C:\hostedtoolcache\windows\Python\3.12.6\x64\Lib\site-packages - - job: BuildWindowsZIP displayName: Build Windows ZIP strategy: diff --git a/build_scripts/windows/scripts/build.cmd b/build_scripts/windows/scripts/build.cmd index 470eec91083..96599d31a85 100644 --- a/build_scripts/windows/scripts/build.cmd +++ b/build_scripts/windows/scripts/build.cmd @@ -94,9 +94,6 @@ if "%TARGET%" == "msi" ( ) ) -rm %PYTHON_DIR% -r -f -rm %BUILDING_DIR% -r -f - REM ensure Python is available if exist %PYTHON_DIR% ( echo Using existing Python at %PYTHON_DIR% @@ -126,6 +123,8 @@ if not exist %PYTHON_DIR% ( REM setuptools is not installed by default in Python 3.12, but it is required by some dependencys REM See https://github.com/Azure/azure-cli/pull/27196 + REM Install wheel to force pip install azure-cli in legacy mode + REM see https://github.com/Azure/azure-cli/pull/29887 echo Installing setuptools wheel %PYTHON_DIR%\python.exe -Im pip install setuptools wheel @@ -139,7 +138,6 @@ robocopy %PYTHON_DIR% %BUILDING_DIR% /s /NFL /NDL set CLI_SRC=%REPO_ROOT%\src for %%a in (%CLI_SRC%\azure-cli %CLI_SRC%\azure-cli-core %CLI_SRC%\azure-cli-telemetry) do ( pushd %%a - echo install %%a %BUILDING_DIR%\python.exe -Im pip install --no-warn-script-location --no-cache-dir --no-deps . if %errorlevel% neq 0 goto ERROR popd @@ -147,12 +145,7 @@ for %%a in (%CLI_SRC%\azure-cli %CLI_SRC%\azure-cli-core %CLI_SRC%\azure-cli-tel %BUILDING_DIR%\python.exe -Im pip install --no-warn-script-location --requirement %CLI_SRC%\azure-cli\requirements.py3.windows.txt if %errorlevel% neq 0 goto ERROR -echo %BUILDING_DIR%\python.exe -Im pip list -%BUILDING_DIR%\python.exe -Im pip list -echo %BUILDING_DIR%\python.exe -m pip list -%BUILDING_DIR%\python.exe -m pip list -echo run azure.cli REM Check azure.cli can be executed. This also prints the Python version. %BUILDING_DIR%\python.exe -Im azure.cli --version if %errorlevel% neq 0 goto ERROR