Skip to content

Commit ac73511

Browse files
committed
Merge remote-tracking branch 'upstream/main' into python-ldap-stubs
# Conflicts: # pyproject.toml
2 parents bc62943 + 56cbde4 commit ac73511

3,891 files changed

Lines changed: 87679 additions & 44710 deletions

File tree

Some content is hidden

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

.flake8

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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+
# Also ignore Y041 (redundant (complex |) float | int), see
6+
# https://github.com/python/typeshed/issues/16059
7+
extend-ignore = Y041,Y090,Y091
78
per-file-ignores =
89
# Generated protobuf files:
910
# 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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"suppressNotifications": ["prEditedNotification"],
55
"extends": ["config:recommended"],
66
"labels": ["bot: dependencies"],
7+
"rebaseLabel": ["bot: rebase"],
78
"semanticCommits": "disabled",
89
"separateMajorMinor": false,
910
"prHourlyLimit": 10,
@@ -24,15 +25,15 @@
2425
{
2526
groupName: "most test/lint dependencies",
2627
matchManagers: ["pip_requirements", "pre-commit"],
27-
matchPackageNames: ["!pytype", "!pyright"],
28+
matchPackageNames: ["!pyright"],
2829
description: "Quarterly update of most test dependencies",
2930
schedule: ["every 3 months on the first day of the month"]
3031
},
3132
{
32-
"groupName": "pytype and pyright",
33+
"groupName": "pyright",
3334
"matchManagers": ["pip_requirements"],
34-
"matchPackageNames": ["pytype", "pyright"],
35-
"description": "Daily update of pyright and pytype",
35+
"matchPackageNames": ["pyright"],
36+
"description": "Daily update of pyright",
3637
"schedule": ["before 4am"]
3738
}
3839
]

.github/workflows/daily.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,22 @@ 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", "3.14-dev"]
38+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
39+
exclude:
40+
# https://github.com/python/typeshed/issues/15694
41+
- os: "windows-latest"
42+
python-version: "3.10"
3943
fail-fast: false
4044

4145
steps:
42-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v7
4347
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
44-
uses: actions/setup-python@v5
48+
uses: actions/setup-python@v6
4549
with:
4650
python-version: ${{ matrix.python-version }}
4751
cache: pip
@@ -55,16 +59,16 @@ jobs:
5559

5660
stubtest-third-party:
5761
name: "stubtest: third party"
58-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
62+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
5963
runs-on: ${{ matrix.os }}
6064
strategy:
6165
matrix:
6266
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
6367
shard-index: [0, 1, 2, 3]
6468
fail-fast: false
6569
steps:
66-
- uses: actions/checkout@v4
67-
- uses: actions/setup-python@v5
70+
- uses: actions/checkout@v7
71+
- uses: actions/setup-python@v6
6872
with:
6973
python-version: "3.13"
7074
cache: pip
@@ -73,55 +77,60 @@ jobs:
7377
stubs/**/METADATA.toml
7478
- name: Install dependencies
7579
run: pip install -r requirements-tests.txt
76-
- name: Run stubtest
80+
- name: Install required system packages
7781
shell: bash
7882
run: |
7983
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
8084
8185
if [ "${{ runner.os }}" = "Linux" ]; then
8286
if [ -n "$PACKAGES" ]; then
87+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8388
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
8489
fi
85-
86-
PYTHON_EXECUTABLE="xvfb-run python"
8790
else
8891
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
92+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8993
brew install -q $PACKAGES
9094
fi
9195
9296
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
97+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
9398
choco install -y $PACKAGES
9499
fi
95-
100+
fi
101+
- name: Run stubtest
102+
shell: bash
103+
run: |
104+
if [ "${{ runner.os }}" = "Linux" ]; then
105+
PYTHON_EXECUTABLE="xvfb-run python"
106+
else
96107
PYTHON_EXECUTABLE="python"
97108
fi
98109
99-
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
110+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
100111
101112
stub-uploader:
102113
name: stub_uploader tests
103-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
114+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
104115
runs-on: ubuntu-latest
105116
steps:
106117
- name: Checkout typeshed
107-
uses: actions/checkout@v4
118+
uses: actions/checkout@v7
108119
with:
109120
path: typeshed
110121
- name: Checkout stub_uploader
111-
uses: actions/checkout@v4
122+
uses: actions/checkout@v7
112123
with:
113124
repository: typeshed-internal/stub_uploader
114125
path: stub_uploader
115-
- uses: actions/setup-python@v5
126+
- uses: astral-sh/setup-uv@v8.2.0
116127
with:
117-
# Keep in sync with stub_uploader's check_scripts.yml workflow.
118-
python-version: "3.13"
119-
- uses: astral-sh/setup-uv@v5
128+
version-file: "typeshed/requirements-tests.txt"
120129
- name: Run tests
121130
run: |
122131
cd stub_uploader
123-
uv pip install -r requirements.txt --system
124-
python -m pytest tests
132+
# Keep Python version in sync with stub_uploader's check_scripts.yml workflow.
133+
uv run --python=3.13 --no-project --with-requirements=requirements.txt -m pytest tests
125134
126135
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
127136
create-issue-on-failure:
@@ -132,7 +141,7 @@ jobs:
132141
permissions:
133142
issues: write
134143
steps:
135-
- uses: actions/github-script@v7
144+
- uses: actions/github-script@v9
136145
with:
137146
github-token: ${{ secrets.GITHUB_TOKEN }}
138147
script: |

.github/workflows/meta_tests.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,18 @@ 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@v7
39+
- uses: astral-sh/setup-uv@v8.2.0
4040
with:
41-
python-version: "3.13"
42-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
43-
- run: uv pip install -r requirements-tests.txt --system
44-
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
41+
version-file: "requirements-tests.txt"
42+
- run: |
43+
uv run \
44+
--python=3.13 \
45+
--no-project \
46+
--with-requirements=requirements-tests.txt \
47+
./tests/typecheck_typeshed.py \
48+
--platform=${{ matrix.platform }}
49+
4550
pyright:
4651
name: Check scripts and tests with pyright
4752
runs-on: ubuntu-latest
@@ -50,33 +55,38 @@ jobs:
5055
python-platform: ["Linux", "Windows"]
5156
fail-fast: false
5257
steps:
53-
- uses: actions/checkout@v4
54-
- uses: actions/setup-python@v5
58+
- uses: actions/checkout@v7
59+
- uses: actions/setup-python@v6
60+
with:
61+
python-version: "3.13"
62+
- uses: astral-sh/setup-uv@v8.2.0
5563
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
64+
version-file: "requirements-tests.txt"
6065
- run: uv pip install -r requirements-tests.txt --system
6166
- name: Run pyright on typeshed
62-
uses: jakebailey/pyright-action@v2
67+
uses: jakebailey/pyright-action@v3
6368
with:
6469
version: PATH
6570
python-platform: ${{ matrix.python-platform }}
66-
python-version: "3.9" # Oldest version supported for running scripts and tests
71+
python-version: "3.10" # Oldest version supported for running scripts and tests
6772
project: ./pyrightconfig.scripts_and_tests.json
73+
6874
stubsabot-dry-run:
6975
name: Stubsabot dry run
7076
runs-on: ubuntu-latest
7177
steps:
72-
- uses: actions/checkout@v4
73-
- uses: actions/setup-python@v5
78+
- uses: actions/checkout@v7
79+
- uses: astral-sh/setup-uv@v8.2.0
7480
with:
75-
python-version: "3.13"
76-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
81+
version-file: "requirements-tests.txt"
7782
- name: Git config
7883
run: |
7984
git config --global user.name stubsabot
8085
git config --global user.email '<>'
81-
- run: uv pip install -r requirements-tests.txt --system
82-
- run: python scripts/stubsabot.py --action-level local
86+
- run: |
87+
uv run \
88+
--python=3.13 \
89+
--no-project \
90+
--with-requirements=requirements-tests.txt \
91+
scripts/stubsabot.py \
92+
--action-level=local

.github/workflows/mypy_primer.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
shard-index: [0, 1, 2, 3]
25+
shard-index: [0, 1, 2, 3, 4, 5]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v7
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
@@ -52,7 +52,7 @@ jobs:
5252
--new v${MYPY_VERSION} --old v${MYPY_VERSION} \
5353
--custom-typeshed-repo typeshed_to_test \
5454
--new-typeshed $GITHUB_SHA --old-typeshed upstream_main \
55-
--num-shards 4 --shard-index ${{ matrix.shard-index }} \
55+
--num-shards 6 --shard-index ${{ matrix.shard-index }} \
5656
--debug \
5757
--output concise \
5858
| tee diff_${{ matrix.shard-index }}.txt
@@ -62,15 +62,15 @@ jobs:
6262
run: |
6363
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
6464
- name: Upload mypy_primer diff + PR number
65-
uses: actions/upload-artifact@v4
65+
uses: actions/upload-artifact@v7
6666
if: ${{ matrix.shard-index == 0 }}
6767
with:
6868
name: mypy_primer_diffs-${{ matrix.shard-index }}
6969
path: |
7070
diff_${{ matrix.shard-index }}.txt
7171
pr_number.txt
7272
- name: Upload mypy_primer diff
73-
uses: actions/upload-artifact@v4
73+
uses: actions/upload-artifact@v7
7474
if: ${{ matrix.shard-index != 0 }}
7575
with:
7676
name: mypy_primer_diffs-${{ matrix.shard-index }}
@@ -84,7 +84,7 @@ jobs:
8484
contents: read
8585
steps:
8686
- name: Merge artifacts
87-
uses: actions/upload-artifact/merge@v4
87+
uses: actions/upload-artifact/merge@v7
8888
with:
8989
name: mypy_primer_diffs
9090
pattern: mypy_primer_diffs-*

.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@v9
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@v9
4848
with:
4949
github-token: ${{ secrets.GITHUB_TOKEN }}
5050
script: |

.github/workflows/stubsabot.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,27 @@ jobs:
1919
if: github.repository == 'python/typeshed'
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v7
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: astral-sh/setup-uv@v8.2.0
2828
with:
29-
python-version: "3.13"
30-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
29+
version-file: "requirements-tests.txt"
3130
- name: git config
3231
run: |
3332
git config --global user.name stubsabot
3433
git config --global user.email '<>'
35-
- name: Install dependencies
36-
run: uv pip install -r requirements-tests.txt --system
3734
- name: Run stubsabot
38-
run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python scripts/stubsabot.py --action-level everything
35+
run: |
36+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
37+
uv run \
38+
--python=3.13 \
39+
--no-project \
40+
--with-requirements=requirements-tests.txt \
41+
scripts/stubsabot.py \
42+
--action-level=everything
3943
4044
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
4145
create-issue-on-failure:
@@ -44,7 +48,7 @@ jobs:
4448
needs: [stubsabot]
4549
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubsabot.result == 'failure') }}
4650
steps:
47-
- uses: actions/github-script@v7
51+
- uses: actions/github-script@v9
4852
with:
4953
github-token: ${{ secrets.GITHUB_TOKEN }}
5054
script: |

.github/workflows/stubtest_stdlib.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ 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", "3.14-dev"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
35+
exclude:
36+
# https://github.com/python/typeshed/issues/15694
37+
- os: "windows-latest"
38+
python-version: "3.10"
3539
fail-fast: false
3640

3741
steps:
38-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v7
3943
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
40-
uses: actions/setup-python@v5
44+
uses: actions/setup-python@v6
4145
with:
4246
python-version: ${{ matrix.python-version }}
4347
cache: pip

0 commit comments

Comments
 (0)