Skip to content

Commit 300b45b

Browse files
committed
Back stubtest-third-party for requirements.txt chages cases
1 parent c1457f6 commit 300b45b

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

.github/workflows/daily.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,56 @@ jobs:
5353
- name: Run stubtest
5454
run: python tests/stubtest_stdlib.py
5555

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+
56106
stub-uploader:
57107
name: stub_uploader tests
58108
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}

.github/workflows/stubtest_third_party.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
shell: bash
5353
run: |
5454
# This only runs stubtest on changed stubs, because it is much faster.
55-
# Use the stubsabot.yml workflow to run stubtest on third-party stubs.
5655
function find_stubs {
5756
git diff --name-only origin/${{ github.base_ref }} HEAD | \
5857
egrep ^stubs/ | cut -d "/" -f 2 | sort -u | \

0 commit comments

Comments
 (0)