Cross-platform third-party stubs requirements install script (#13482)

This commit is contained in:
Avasam
2025-02-09 16:21:22 -05:00
committed by GitHub
parent 46ac2e24a4
commit c99e54da3e
6 changed files with 51 additions and 40 deletions

View File

@@ -47,11 +47,10 @@ jobs:
- run: uv pip install -r requirements-tests.txt --system
- name: Install external dependencies for 3rd-party stubs
run: |
mapfile -t DEPENDENCIES < <( python tests/get_external_stub_requirements.py )
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
if [ -n "$DEPENDENCIES" ]; then
echo "Installing packages:"
for DEP in "${DEPENDENCIES[@]}"; do echo " ${DEP}"; done
uv pip install "${DEPENDENCIES[@]}" --system
printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
uv pip install --system $DEPENDENCIES
fi
- run: uv pip freeze
- run: ./tests/pytype_test.py --print-stderr
@@ -108,14 +107,13 @@ jobs:
run: uv venv .venv
- name: Install 3rd-party stub dependencies
run: |
mapfile -t DEPENDENCIES < <( python tests/get_external_stub_requirements.py )
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
if [ -n "$DEPENDENCIES" ]; then
echo "Installing packages:"
for DEP in "${DEPENDENCIES[@]}"; do echo " ${DEP}"; done
printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
# TODO: We need to specify the platform here, but the platforms
# strings supported by uv are different from the ones supported by
# pyright.
uv pip install --python-version ${{ matrix.python-version }} "${DEPENDENCIES[@]}"
uv pip install --python-version ${{ matrix.python-version }} $DEPENDENCIES
fi
- name: Activate the isolated venv for the rest of the job
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH