fix: make setup-dependencies portable on macOS (#1463)

Two issues prevented the script from running on macOS without manual intervention:

1. `sed -i` requires a backup suffix on macOS BSD sed. Replace with a
   portable `grep -v | mv` idiom that works on both macOS and Linux.

2. `python` is not in PATH on macOS by default. Replace with `python3`.

Co-authored-by: Florian Horner <florianhorner@macbook-pro-von-florian.tail6f28f8.ts.net>
Co-authored-by: Bas Nijholt <basnijholt@users.noreply.github.com>
This commit is contained in:
Florian 2026-04-24 22:12:20 +02:00 committed by GitHub
commit b787c533bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@ cd "$(dirname "$0")/.."
# Remove mypy-dev from requirements_test.txt since the maintainer deletes old versions from PyPI.
# We'll install the latest version separately below.
# See: https://github.com/cdce8p/mypy-dev/issues/62
sed -i '/^mypy-dev/d' core/requirements_test.txt
grep -v '^mypy-dev' core/requirements_test.txt > core/requirements_test.txt.tmp && mv core/requirements_test.txt.tmp core/requirements_test.txt
uv pip install -r core/requirements.txt
uv pip install -r core/requirements_test.txt
@ -35,7 +35,7 @@ done
uv pip install -e core/
uv pip install ulid-transform # this is in Adaptive-lighting's manifest.json
uv pip install $(python test_dependencies.py)
uv pip install $(python3 test_dependencies.py)
# Install the latest mypy-dev (not pinned since old versions get deleted from PyPI)
uv pip install --upgrade mypy-dev