Skip to content

Commit a8f3f20

Browse files
committed
[CI] Install apt dependencies when running test cases with pyright
Closes: #13973
1 parent 8fdd476 commit a8f3f20

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ jobs:
107107
- name: Install typeshed test-suite requirements
108108
# Install these so we can run `get_external_stub_requirements.py`
109109
run: uv pip install -r requirements-tests.txt --system
110+
- name: Install required APT packages
111+
run: |
112+
DEPENDENCIES=$( python tests/get_external_apt_dependencies.py )
113+
if [ -n "$DEPENDENCIES" ]; then
114+
printf "Installing APT packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
115+
apt-get install -qy $DEPENDENCIES
116+
fi
110117
- name: Create an isolated venv for testing
111118
run: uv venv .venv
112119
- name: Install 3rd-party stub dependencies
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
3+
import itertools
4+
import os
5+
import sys
6+
7+
from ts_utils.metadata import read_metadata
8+
from ts_utils.paths import STUBS_PATH
9+
10+
if __name__ == "__main__":
11+
distributions = sys.argv[1:]
12+
if not distributions:
13+
distributions = os.listdir(STUBS_PATH)
14+
dependencies = set(itertools.chain.from_iterable(
15+
read_metadata(distribution).stubtest_settings.apt_dependencies for distribution in distributions
16+
))
17+
for dependency in sorted(dependencies):
18+
print(dependency)

0 commit comments

Comments
 (0)