|
53 | 53 | - name: Run stubtest |
54 | 54 | run: python tests/stubtest_stdlib.py |
55 | 55 |
|
| 56 | + # This job only runs when requirements.txt is changed |
| 57 | + stubtest-third-party: |
| 58 | + name: "stubtest: third party" |
| 59 | + if: ${{ github.repository == 'python/typeshed' && github.event_name != 'schedule' }} |
| 60 | + runs-on: ${{ matrix.os }} |
| 61 | + strategy: |
| 62 | + matrix: |
| 63 | + os: ["ubuntu-latest", "windows-latest", "macos-latest"] |
| 64 | + shard-index: [0, 1, 2, 3] |
| 65 | + fail-fast: false |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v5 |
| 68 | + - uses: actions/setup-python@v6 |
| 69 | + with: |
| 70 | + python-version: "3.13" |
| 71 | + cache: pip |
| 72 | + cache-dependency-path: | |
| 73 | + requirements-tests.txt |
| 74 | + stubs/**/METADATA.toml |
| 75 | + - name: Install dependencies |
| 76 | + run: pip install -r requirements-tests.txt |
| 77 | + - name: Install required system packages |
| 78 | + shell: bash |
| 79 | + run: | |
| 80 | + PACKAGES=$(python tests/get_stubtest_system_requirements.py) |
| 81 | + if [ "${{ runner.os }}" = "Linux" ]; then |
| 82 | + if [ -n "$PACKAGES" ]; then |
| 83 | + printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n" |
| 84 | + sudo apt-get update -q && sudo apt-get install -qy $PACKAGES |
| 85 | + fi |
| 86 | + else |
| 87 | + if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then |
| 88 | + printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n" |
| 89 | + brew install -q $PACKAGES |
| 90 | + fi |
| 91 | + if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then |
| 92 | + printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n" |
| 93 | + choco install -y $PACKAGES |
| 94 | + fi |
| 95 | + fi |
| 96 | + - name: Run stubtest |
| 97 | + shell: bash |
| 98 | + run: | |
| 99 | + if [ "${{ runner.os }}" = "Linux" ]; then |
| 100 | + PYTHON_EXECUTABLE="xvfb-run python" |
| 101 | + else |
| 102 | + PYTHON_EXECUTABLE="python" |
| 103 | + fi |
| 104 | + $PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }} |
| 105 | +
|
56 | 106 | stub-uploader: |
57 | 107 | name: stub_uploader tests |
58 | 108 | if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }} |
|
0 commit comments