-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{CI} Fix Python wheels Test #27102
{CI} Fix Python wheels Test #27102
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
CI |
Why is the log not in English but Azerbaijani?
|
@@ -449,12 +449,12 @@ jobs: | |||
echo "== Testing pip install on Python 3.9 ==" | |||
docker run \ | |||
--rm -v $PYPI_FILES:/mnt/pypi python:3.9 \ | |||
/bin/bash -c "ls /mnt/pypi && pip install -f /mnt/pypi -q azure-cli==$CLI_VERSION.* && az self-test && az --version && sleep 5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test for Python 3.7 was removed by #27015.
.*
was initially added by 4baa9d8 from #16362.
I made a test on the built artifact and noticed *
is not expanded by the shell if no matching file exists:
$ curl https://artprodwus21.artifacts.visualstudio.com/A7b238909-6802-4b65-b90d-184bca47f458/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6Y2xpdG9vbHMvcHJvamVjdElkLzUxNDdmYTgzLTMzNmUtNDRlZi1iYmUwLWM4NmI4YWU4NmNiYi9idWlsZElkLzgyNDg5L2FydGlmYWN0TmFtZS9weXBp0/content?format=zip -o pypi.zip
$ unzip pypi.zip
$ cd pypi
$ echo azure-*
azure-cli-2.51.0.post20230815081512.tar.gz azure-cli-core-2.51.0.post20230815081512.tar.gz azure-cli-telemetry-1.1.0.post20230815081512.tar.gz
$ CLI_VERSION=2.51.0
$ echo azure-cli==$CLI_VERSION.*
azure-cli==2.51.0.*
Since #27001, 2.50.0.post*
on the local disk is not compatible with Python 3.7, so pip
falls back to a compatible version 2.50.0
from PyPI.
azure-pipelines.yml
Outdated
@@ -449,12 +449,12 @@ jobs: | |||
echo "== Testing pip install on Python 3.9 ==" | |||
docker run \ | |||
--rm -v $PYPI_FILES:/mnt/pypi python:3.9 \ | |||
/bin/bash -c "ls /mnt/pypi && pip install -f /mnt/pypi -q azure-cli==$CLI_VERSION.* && az self-test && az --version && sleep 5" | |||
/bin/bash -c "cd /mnt/pypi && ls && pip install -f ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why cd into /mnt/pypi
? Is -f ./
still necessary now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to write full path in -f
and whl file.
Yes, the azure_cli-$CLI_VERSION*whl
requires azure-cli-core-XX.post
, we need to add this folder into additional repositories.
azure-pipelines.yml
Outdated
@@ -449,12 +449,12 @@ jobs: | |||
echo "== Testing pip install on Python 3.9 ==" | |||
docker run \ | |||
--rm -v $PYPI_FILES:/mnt/pypi python:3.9 \ | |||
/bin/bash -c "ls /mnt/pypi && pip install -f /mnt/pypi -q azure-cli==$CLI_VERSION.* && az self-test && az --version && sleep 5" | |||
/bin/bash -c "cd /mnt/pypi && ls && pip install -f ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we force it to install the whl
packages, there will be no need to care about $CLI_VERSION
. I guess we may simply use azure_cli*.whl
to install all local wheels:
/bin/bash -c "cd /mnt/pypi && ls && pip install -f ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5" | |
/bin/bash -c "cd /mnt/pypi && ls && pip install azure_cli*.whl && az self-test && az --version && sleep 5" |
This will include
$ echo azure_cli*.whl
azure_cli-2.51.0.post20230815081512-py3-none-any.whl
azure_cli_core-2.51.0.post20230815081512-py3-none-any.whl
azure_cli_telemetry-1.1.0.post20230815081512-py3-none-any.whl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip install azure_cli*.whl
also works, but I want to make this test command close to the real scenario: pip install azure-cli
.
My OpenAI Translator extension is triggered unexpectedly.
|
@@ -449,12 +449,12 @@ jobs: | |||
echo "== Testing pip install on Python 3.9 ==" | |||
docker run \ | |||
--rm -v $PYPI_FILES:/mnt/pypi python:3.9 \ | |||
/bin/bash -c "ls /mnt/pypi && pip install -f /mnt/pypi -q azure-cli==$CLI_VERSION.* && az self-test && az --version && sleep 5" | |||
/bin/bash -c "cd /mnt/pypi && ls && pip install --find-links ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be good practice to always make *
match as little as possible:
/bin/bash -c "cd /mnt/pypi && ls && pip install --find-links ./ azure_cli-$CLI_VERSION*whl && az self-test && az --version && sleep 5" | |
/bin/bash -c "cd /mnt/pypi && ls && pip install --find-links ./ azure_cli-*-py3-none-any.whl && az self-test && az --version && sleep 5" |
Description
In this PR, I change the command to install the wheel directly, to make sure it does not install package from pypi
When releasing 2.51.0, Test Python Wheels fails with this error:
That's expected, as 2.51 does not support 3.7. I'm curious why this test does not find this error earlier.
In fact,
pip install -f /mnt/pypi -q azure-cli==$CLI_VERSION.*
never runs as expected.This command add
/mnt/pypi
into search path, and try to installazure-cli==$CLI_VERSION.*
. It has two problem:/mnt/pypi
does not have higher priority, if pypi contains the specific version, it may install from pypi instead of local$CLI_VERSION.*
includes$CLI_VERSION
, which can be found from pypi.Here is the log in python 3.7. I guess it tries to install local version first, which is not compatible with 3.7, then install 2.50 from pypi.
Here is the log for 3.8. It successfully installs the local wheel.