Skip to content

Commit b93fe7f

Browse files
Merge branch 'main' into contexmanager/deprecate-iterator-signature
2 parents c1cc48a + bc49fc5 commit b93fe7f

File tree

2,857 files changed

+62002
-28485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,857 files changed

+62002
-28485
lines changed

.flake8

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[flake8]
22
# Y: Flake8 is only used to run flake8-pyi, everything else is in Ruff
3-
# F821: Typeshed is a testing ground for flake8-pyi, which monkeypatches F821
4-
select = Y, F821
3+
select = Y
54
# Ignore rules normally excluded by default
6-
extend-ignore = Y090
5+
extend-ignore = Y090,Y091
76
per-file-ignores =
87
# Generated protobuf files:
98
# Y021: Include docstrings

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
# Set linguist-language to support comments syntax highlight
55
**/stubtest_allowlist*.txt linguist-language=ini
66
**/stubtest_allowlists/*.txt linguist-language=ini
7-
tests/pytype_exclude_list.txt linguist-language=ini
87
pyrightconfig*.json linguist-language=jsonc
98
.vscode/*.json linguist-language=jsonc

.github/renovate.json5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
{
2525
groupName: "most test/lint dependencies",
2626
matchManagers: ["pip_requirements", "pre-commit"],
27-
matchPackageNames: ["!pytype", "!pyright"],
27+
matchPackageNames: ["!pyright"],
2828
description: "Quarterly update of most test dependencies",
2929
schedule: ["every 3 months on the first day of the month"]
3030
},
3131
{
32-
"groupName": "pytype and pyright",
32+
"groupName": "pyright",
3333
"matchManagers": ["pip_requirements"],
34-
"matchPackageNames": ["pytype", "pyright"],
35-
"description": "Daily update of pyright and pytype",
34+
"matchPackageNames": ["pyright"],
35+
"description": "Daily update of pyright",
3636
"schedule": ["before 4am"]
3737
}
3838
]

.github/workflows/daily.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ env:
3030
jobs:
3131
stubtest-stdlib:
3232
name: "stubtest: stdlib"
33-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
33+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
3434
runs-on: ${{ matrix.os }}
3535
strategy:
3636
matrix:
3737
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
38+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3939
fail-fast: false
4040

4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
4343
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
44-
uses: actions/setup-python@v5
44+
uses: actions/setup-python@v6
4545
with:
4646
python-version: ${{ matrix.python-version }}
4747
cache: pip
@@ -50,21 +50,24 @@ jobs:
5050
check-latest: true
5151
- name: Install dependencies
5252
run: pip install -r requirements-tests.txt
53+
# Temporary to get @disjoint_base support; can remove once mypy 1.18 is released
54+
- name: Install mypy from git
55+
run: pip install git+https://github.com/python/mypy.git@116b92bae7b5dbf5e6bd36fd9b0c6804973e5554
5356
- name: Run stubtest
5457
run: python tests/stubtest_stdlib.py
5558

5659
stubtest-third-party:
5760
name: "stubtest: third party"
58-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
61+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
5962
runs-on: ${{ matrix.os }}
6063
strategy:
6164
matrix:
6265
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
6366
shard-index: [0, 1, 2, 3]
6467
fail-fast: false
6568
steps:
66-
- uses: actions/checkout@v4
67-
- uses: actions/setup-python@v5
69+
- uses: actions/checkout@v5
70+
- uses: actions/setup-python@v6
6871
with:
6972
python-version: "3.13"
7073
cache: pip
@@ -73,50 +76,59 @@ jobs:
7376
stubs/**/METADATA.toml
7477
- name: Install dependencies
7578
run: pip install -r requirements-tests.txt
76-
- name: Run stubtest
79+
- name: Install required system packages
7780
shell: bash
7881
run: |
7982
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
8083
8184
if [ "${{ runner.os }}" = "Linux" ]; then
8285
if [ -n "$PACKAGES" ]; then
86+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8387
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
8488
fi
85-
86-
PYTHON_EXECUTABLE="xvfb-run python"
8789
else
8890
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
91+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8992
brew install -q $PACKAGES
9093
fi
9194
9295
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
96+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
9397
choco install -y $PACKAGES
9498
fi
95-
99+
fi
100+
- name: Run stubtest
101+
shell: bash
102+
run: |
103+
if [ "${{ runner.os }}" = "Linux" ]; then
104+
PYTHON_EXECUTABLE="xvfb-run python"
105+
else
96106
PYTHON_EXECUTABLE="python"
97107
fi
98108
99-
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
109+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
100110
101111
stub-uploader:
102112
name: stub_uploader tests
103-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
113+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
104114
runs-on: ubuntu-latest
105115
steps:
106116
- name: Checkout typeshed
107-
uses: actions/checkout@v4
117+
uses: actions/checkout@v5
108118
with:
109119
path: typeshed
110120
- name: Checkout stub_uploader
111-
uses: actions/checkout@v4
121+
uses: actions/checkout@v5
112122
with:
113123
repository: typeshed-internal/stub_uploader
114124
path: stub_uploader
115-
- uses: actions/setup-python@v5
125+
- uses: actions/setup-python@v6
116126
with:
117127
# Keep in sync with stub_uploader's check_scripts.yml workflow.
118128
python-version: "3.13"
119-
- uses: astral-sh/setup-uv@v5
129+
- uses: astral-sh/setup-uv@v6
130+
with:
131+
version-file: "typeshed/requirements-tests.txt"
120132
- name: Run tests
121133
run: |
122134
cd stub_uploader
@@ -132,7 +144,7 @@ jobs:
132144
permissions:
133145
issues: write
134146
steps:
135-
- uses: actions/github-script@v7
147+
- uses: actions/github-script@v8
136148
with:
137149
github-token: ${{ secrets.GITHUB_TOKEN }}
138150
script: |

.github/workflows/meta_tests.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ jobs:
3535
platform: ["linux", "win32"]
3636
fail-fast: false
3737
steps:
38-
- uses: actions/checkout@v4
39-
- uses: actions/setup-python@v5
38+
- uses: actions/checkout@v5
39+
- uses: actions/setup-python@v6
4040
with:
4141
python-version: "3.13"
42-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
42+
- uses: astral-sh/setup-uv@v6
43+
with:
44+
version-file: "requirements-tests.txt"
4345
- run: uv pip install -r requirements-tests.txt --system
4446
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4547
pyright:
@@ -50,13 +52,13 @@ jobs:
5052
python-platform: ["Linux", "Windows"]
5153
fail-fast: false
5254
steps:
53-
- uses: actions/checkout@v4
54-
- uses: actions/setup-python@v5
55+
- uses: actions/checkout@v5
56+
- uses: actions/setup-python@v6
57+
with:
58+
python-version: "3.13"
59+
- uses: astral-sh/setup-uv@v6
5560
with:
56-
# TODO: Since pytype is not available for Python 3.13, and
57-
# pytype_test.py imports pytype, we need to use Python 3.12 for now.
58-
python-version: "3.12"
59-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
61+
version-file: "requirements-tests.txt"
6062
- run: uv pip install -r requirements-tests.txt --system
6163
- name: Run pyright on typeshed
6264
uses: jakebailey/pyright-action@v2
@@ -69,11 +71,13 @@ jobs:
6971
name: Stubsabot dry run
7072
runs-on: ubuntu-latest
7173
steps:
72-
- uses: actions/checkout@v4
73-
- uses: actions/setup-python@v5
74+
- uses: actions/checkout@v5
75+
- uses: actions/setup-python@v6
7476
with:
7577
python-version: "3.13"
76-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
78+
- uses: astral-sh/setup-uv@v6
79+
with:
80+
version-file: "requirements-tests.txt"
7781
- name: Git config
7882
run: |
7983
git config --global user.name stubsabot

.github/workflows/mypy_primer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
shard-index: [0, 1, 2, 3]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
2929
with:
3030
path: typeshed_to_test
3131
fetch-depth: 0
32-
- uses: actions/setup-python@v5
32+
- uses: actions/setup-python@v6
3333
with:
3434
python-version: "3.13"
3535
- name: Install dependencies

.github/workflows/mypy_primer_comment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1919
steps:
2020
- name: Download diffs
21-
uses: actions/github-script@v7
21+
uses: actions/github-script@v8
2222
with:
2323
script: |
2424
const fs = require('fs');
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Post comment
4646
id: post-comment
47-
uses: actions/github-script@v7
47+
uses: actions/github-script@v8
4848
with:
4949
github-token: ${{ secrets.GITHUB_TOKEN }}
5050
script: |

.github/workflows/stubsabot.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ jobs:
1919
if: github.repository == 'python/typeshed'
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
with:
2424
# use an ssh key so that checks automatically run on stubsabot PRs
2525
ssh-key: ${{ secrets.STUBSABOT_SSH_PRIVATE_KEY }}
2626
fetch-depth: 0
27-
- uses: actions/setup-python@v5
27+
- uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.13"
30-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
30+
- uses: astral-sh/setup-uv@v6
31+
with:
32+
version-file: "requirements-tests.txt"
3133
- name: git config
3234
run: |
3335
git config --global user.name stubsabot
@@ -44,7 +46,7 @@ jobs:
4446
needs: [stubsabot]
4547
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubsabot.result == 'failure') }}
4648
steps:
47-
- uses: actions/github-script@v7
49+
- uses: actions/github-script@v8
4850
with:
4951
github-token: ${{ secrets.GITHUB_TOKEN }}
5052
script: |

.github/workflows/stubtest_stdlib.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
strategy:
3232
matrix:
3333
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
34-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
34+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3535
fail-fast: false
3636

3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v5
3939
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
40-
uses: actions/setup-python@v5
40+
uses: actions/setup-python@v6
4141
with:
4242
python-version: ${{ matrix.python-version }}
4343
cache: pip
@@ -46,5 +46,8 @@ jobs:
4646
check-latest: true
4747
- name: Install dependencies
4848
run: pip install -r requirements-tests.txt
49+
# Temporary to get @disjoint_base support; can remove once mypy 1.18 is released
50+
- name: Install mypy from git
51+
run: pip install git+https://github.com/python/mypy.git@116b92bae7b5dbf5e6bd36fd9b0c6804973e5554
4952
- name: Run stubtest
5053
run: python tests/stubtest_stdlib.py

.github/workflows/stubtest_third_party.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
fail-fast: false
3737

3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v5
4040
with:
4141
fetch-depth: 0
42-
- uses: actions/setup-python@v5
42+
- uses: actions/setup-python@v6
4343
with:
4444
python-version: "3.13"
4545
cache: pip
@@ -48,44 +48,54 @@ jobs:
4848
stubs/**/METADATA.toml
4949
- name: Install dependencies
5050
run: pip install -r requirements-tests.txt
51-
- name: Run stubtest
51+
- name: Determine changed stubs
5252
shell: bash
5353
run: |
5454
# This only runs stubtest on changed stubs, because it is much faster.
5555
# Use the daily.yml workflow to run stubtest on all third party stubs.
5656
function find_stubs {
5757
git diff --name-only origin/${{ github.base_ref }} HEAD | \
5858
egrep ^stubs/ | cut -d "/" -f 2 | sort -u | \
59-
(while read stub; do [ -d "stubs/$stub" ] && echo "$stub" || true; done)
59+
(while read stub; do [ -d "stubs/$stub" ] && echo -n "$stub " || true; done)
6060
}
6161
STUBS=$(find_stubs || echo '')
62-
62+
echo "Changed stubs: $STUBS"
63+
echo "STUBS=$STUBS" >> $GITHUB_ENV
64+
- name: Install required system packages
65+
shell: bash
66+
run: |
6367
if [ -n "$STUBS" ]; then
64-
echo "Testing $STUBS..."
6568
PACKAGES=$(python tests/get_stubtest_system_requirements.py $STUBS)
66-
6769
if [ "${{ runner.os }}" = "Linux" ]; then
6870
if [ -n "$PACKAGES" ]; then
69-
echo "Installing apt packages: $PACKAGES"
71+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
7072
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
7173
fi
72-
73-
PYTHON_EXECUTABLE="xvfb-run python"
7474
else
7575
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
76-
echo "Installing Homebrew packages: $PACKAGES"
76+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
7777
brew install -q $PACKAGES
7878
fi
7979
8080
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
81-
echo "Installing Chocolatey packages: $PACKAGES"
81+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8282
choco install -y $PACKAGES
8383
fi
84+
fi
85+
fi
86+
- name: Run stubtest
87+
shell: bash
88+
run: |
89+
if [ -n "$STUBS" ]; then
90+
echo "Testing $STUBS..."
8491
92+
if [ "${{ runner.os }}" = "Linux" ]; then
93+
PYTHON_EXECUTABLE="xvfb-run python"
94+
else
8595
PYTHON_EXECUTABLE="python"
8696
fi
8797
88-
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only $STUBS
98+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only $STUBS
8999
else
90100
echo "Nothing to test"
91101
fi

0 commit comments

Comments
 (0)