Skip to content

Commit

Permalink
Fix broken MacOS and Ubuntu18.04 runs. (#4517)
Browse files Browse the repository at this point in the history
* Support Ubuntu 18.04 black.

* Fix broken CI runs.

* Always pass the brew command.

* Use aggressive method for MacOS-13 only.
  • Loading branch information
fruffy authored Mar 12, 2024
1 parent 8e1956e commit b2c29a5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci-test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ jobs:

- name: Install dependencies (MacOS)
run: |
# FIXME: We should not need to do this, but there are currently some complications with Github CI.
# See https://github.com/actions/runner-images/issues/4020.
# See https://github.com/actions/runner-images/issues/8838.
brew unlink [email protected]
brew uninstall --force azure-cli
brew uninstall --force aws-sam-cli
brew uninstall --force pipx
brew uninstall --force [email protected]
brew uninstall --force [email protected]
rm -f '/usr/local/bin/2to3'
rm -f '/usr/local/bin/2to3-3.12'
rm -f '/usr/local/bin/idle3'
rm -f '/usr/local/bin/idle3.12'
rm -f '/usr/local/bin/pydoc3'
rm -f '/usr/local/bin/pydoc3.12'
rm -f '/usr/local/bin/python3'
rm -f '/usr/local/bin/python3-config'
rm -f '/usr/local/bin/python3.12'
rm -f '/usr/local/bin/python3.12-config'
brew install python@3 || brew link --overwrite python@3
tools/install_mac_deps.sh
- name: Build (MacOS)
Expand Down
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ ply==3.11
ptf==0.9.4
scapy==2.5.0
clang-format==18.1.0
black==24.2.0
isort==5.13.2
isort==5.13.2; python_version > '3.6'
black==24.2.0; python_version > '3.6'
protobuf==3.20.2; python_version > '3.6'
grpcio==1.59.3; python_version > '3.6'
googleapis-common-protos==1.53.0; python_version > '3.6'
# Ubuntu 18.04 uses Python 3.6, which is not supported by recent versions of Protobuf.
# Ubuntu 18.04 uses Python 3.6, which is not supported by recent versions of Protobuf and Black.
protobuf==3.19.2; python_version <= '3.6'
googleapis-common-protos==1.53.0; python_version <= '3.6'
grpcio==1.48.2; python_version <= '3.6'
isort==5.10.1; python_version <= '3.6'
black==22.8.0; python_version <= '3.6'
3 changes: 2 additions & 1 deletion tools/install_mac_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ fi
source ~/.bash_profile

# Install required pip packages
pip3 install --user -r requirements.txt
# TODO: Should we use --break-system-packages or should we set up a venv?
pip3 install --user --break-system-packages -r requirements.txt

0 comments on commit b2c29a5

Please sign in to comment.