Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bebound committed Oct 16, 2024
1 parent ea25cd5 commit 06ef160
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 280 deletions.
271 changes: 0 additions & 271 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 2 additions & 9 deletions build_scripts/windows/scripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down Expand Up @@ -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

Expand All @@ -139,20 +138,14 @@ 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
)

%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
Expand Down

0 comments on commit 06ef160

Please sign in to comment.