Skip to content

fix(ci): don't use pip3 to install awscli - #3786

Merged
rami3l merged 2 commits into
masterfrom
fix/dist-awscli-macos
Apr 24, 2024
Merged

fix(ci): don't use pip3 to install awscli#3786
rami3l merged 2 commits into
masterfrom
fix/dist-awscli-macos

Conversation

@rami3l

@rami3lrami3l commented Apr 23, 2024

Copy link
Copy Markdown
Member

The current stable CI is almost perfect except it gives this error on macos-14:

$ pip3 install awsclierror: externally-managed-environment× This environment is externally managed╰─> To install Python packages system-wide, try brew install xyz, where xyz is the package you are trying to install. If you wish to install a Python library that isn't in Homebrew, use a virtual environment: python3 -m venv path/to/venv source path/to/venv/bin/activate python3 -m pip install xyz If you wish to install a Python application that isn't in Homebrew, it may be easiest to use 'pipx install xyz', which will manage a virtual environment for you. You can install pipx with brew install pipx You may restore the old behavior of pip by passing the '--break-system-packages' flag to pip, or by adding 'break-system-packages = true' to your pip.conf file. The latter will permanently disable this error. If you disable this error, we STRONGLY recommend that you additionally pass the '--user' flag to pip, or set 'user = true' in your pip.conf file. Failure to do this can result in a broken Homebrew installation. Read more about this behavior here: <https://peps.python.org/pep-0668/>note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.hint: See PEP 668 for the detailed specification.

This is actions/runner-images#8615; it so happened that when we were releasing v1.27.0, pip3 was on Python v3.11, so that didn't bring up any error message.

Since awscli is already bundled in macos-(12|14) and ubuntu-*, pip3 install awscli actually has no effect. I think it’d be better to make the installation line a version check instead.
For windows runners, the existing awscli is already choco-managed, so there's nothing to be done.

It's worth noticing that the preinstalled awscli is on v2, but on pip we have awscli 1.32.89 as the latest version. However, given that we've already used the v2 for release purposes unintentionally for quite a while now, the differences here regarding the specific aws s3 cp command should be minimal.

This fix cannot be properly tested since it touches some part of the release process, but the aws --version part has been tested and is guaranteed to work.

@rami3l
rami3l requested review from djc and rbtcollinsApril 23, 2024 14:21
@rami3l
rami3l enabled auto-merge April 23, 2024 14:37
@rami3lrami3l added this to the 1.27.1 milestone Apr 24, 2024
@rami3l
rami3l disabled auto-merge April 24, 2024 01:30
@rami3l

This comment was marked as resolved.

@rami3l
rami3l marked this pull request as draft April 24, 2024 01:38
@rami3lrami3l changed the title fix(ci): use brew to install awscli on macOS runnersfix(ci): don't use pip3 to install awscli on macOS runnersApr 24, 2024
@rami3lrami3l changed the title fix(ci): don't use pip3 to install awscli on macOS runnersfix(ci): fix error on pip3 install awscliApr 24, 2024
@rami3l
rami3lforce-pushed the fix/dist-awscli-macos branch from 331ccbb to e44ba70CompareApril 24, 2024 02:52
@rami3l
rami3l marked this pull request as ready for review April 24, 2024 02:54
@rami3l
rami3lforce-pushed the fix/dist-awscli-macos branch from dcb559c to 2e52628CompareApril 24, 2024 03:01
@rami3lrami3l changed the title fix(ci): fix error on pip3 install awsclifix(ci): don't use pip3 to install awscliApr 24, 2024
@rami3l
rami3lforce-pushed the fix/dist-awscli-macos branch from 2e52628 to 6bf342aCompareApril 24, 2024 03:12
@rami3l
rami3l enabled auto-merge April 24, 2024 03:36
djc
djc approved these changes Apr 24, 2024
@rami3l
rami3l added this pull request to the merge queue Apr 24, 2024
@djc

djc commented Apr 24, 2024

Copy link
Copy Markdown
Contributor

Nice work looking into this!

Merged via the queue into master with commit a8e4f5cApr 24, 2024
@rami3l
rami3l deleted the fix/dist-awscli-macos branch April 24, 2024 08:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rami3l@djc