Skip to content

Commit 93ac55a

Browse files
authored
Merge branch 'main' into opt-authlib
2 parents 9aa33fa + 40127a6 commit 93ac55a

1,116 files changed

Lines changed: 30277 additions & 21234 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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# Y: Flake8 is only used to run flake8-pyi, everything else is in Ruff
33
select = Y
44
# Ignore rules normally excluded by default
5-
extend-ignore = Y090,Y091
5+
# Also ignore Y041 (redundant (complex |) float | int), see
6+
# https://github.com/python/typeshed/issues/16059
7+
extend-ignore = Y041,Y090,Y091
68
per-file-ignores =
79
# Generated protobuf files:
810
# Y021: Include docstrings

‎.github/renovate.json5‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"dependencyDashboard": true,
44
"suppressNotifications": ["prEditedNotification"],
5-
"extends": ["config:recommended"],
5+
"extends": ["config:recommended", "helpers:pinGitHubActionDigests"],
66
"labels": ["bot: dependencies"],
77
"rebaseLabel": ["bot: rebase"],
88
"semanticCommits": "disabled",

‎.github/workflows/daily.yml‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Daily test
1+
name: Daily tests
22

33
on:
44
workflow_dispatch:
@@ -43,9 +43,11 @@ jobs:
4343
fail-fast: false
4444

4545
steps:
46-
- uses: actions/checkout@v7
46+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
47+
with:
48+
persist-credentials: false
4749
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
48-
uses: actions/setup-python@v6
50+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
4951
with:
5052
python-version: ${{ matrix.python-version }}
5153
cache: pip
@@ -67,8 +69,10 @@ jobs:
6769
shard-index: [0, 1, 2, 3]
6870
fail-fast: false
6971
steps:
70-
- uses: actions/checkout@v7
71-
- uses: actions/setup-python@v6
72+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
73+
with:
74+
persist-credentials: false
75+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
7276
with:
7377
python-version: "3.13"
7478
cache: pip
@@ -115,15 +119,17 @@ jobs:
115119
runs-on: ubuntu-latest
116120
steps:
117121
- name: Checkout typeshed
118-
uses: actions/checkout@v7
122+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
119123
with:
120124
path: typeshed
125+
persist-credentials: false
121126
- name: Checkout stub_uploader
122-
uses: actions/checkout@v7
127+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
123128
with:
124129
repository: typeshed-internal/stub_uploader
125130
path: stub_uploader
126-
- uses: astral-sh/setup-uv@v8.2.0
131+
persist-credentials: false
132+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
127133
with:
128134
version-file: "typeshed/requirements-tests.txt"
129135
- name: Run tests
@@ -141,7 +147,7 @@ jobs:
141147
permissions:
142148
issues: write
143149
steps:
144-
- uses: actions/github-script@v9
150+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
145151
with:
146152
github-token: ${{ secrets.GITHUB_TOKEN }}
147153
script: |

‎.github/workflows/meta_tests.yml‎

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This workflow is for testing typeshed's scripts and tests themselves
2-
name: Meta-tests
2+
name: Infrastructure tests
33

44
on:
55
workflow_dispatch:
@@ -28,18 +28,21 @@ concurrency:
2828

2929
jobs:
3030
mypy:
31-
name: Check scripts and tests with mypy
31+
name: "mypy: type check"
3232
runs-on: ubuntu-latest
3333
strategy:
3434
matrix:
3535
platform: ["linux", "win32"]
3636
fail-fast: false
3737
steps:
38-
- uses: actions/checkout@v7
39-
- uses: astral-sh/setup-uv@v8.2.0
38+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
39+
with:
40+
persist-credentials: false
41+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
4042
with:
4143
version-file: "requirements-tests.txt"
42-
- run: |
44+
- name: Run check_typeshed_structure.py
45+
run: |
4346
uv run \
4447
--python=3.13 \
4548
--no-project \
@@ -48,42 +51,47 @@ jobs:
4851
--platform=${{ matrix.platform }}
4952
5053
pyright:
51-
name: Check scripts and tests with pyright
54+
name: "pyright: type check"
5255
runs-on: ubuntu-latest
5356
strategy:
5457
matrix:
5558
python-platform: ["Linux", "Windows"]
5659
fail-fast: false
5760
steps:
58-
- uses: actions/checkout@v7
59-
- uses: actions/setup-python@v6
61+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
62+
with:
63+
persist-credentials: false
64+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
6065
with:
6166
python-version: "3.13"
62-
- uses: astral-sh/setup-uv@v8.2.0
67+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
6368
with:
6469
version-file: "requirements-tests.txt"
6570
- run: uv pip install -r requirements-tests.txt --system
6671
- name: Run pyright on typeshed
67-
uses: jakebailey/pyright-action@v3
72+
uses: jakebailey/pyright-action@8ec14b5cfe41f26e5f41686a31eb6012758217ef # v3
6873
with:
6974
version: PATH
7075
python-platform: ${{ matrix.python-platform }}
7176
python-version: "3.10" # Oldest version supported for running scripts and tests
7277
project: ./pyrightconfig.scripts_and_tests.json
7378

7479
stubsabot-dry-run:
75-
name: Stubsabot dry run
80+
name: "stubsabot: dry run"
7681
runs-on: ubuntu-latest
7782
steps:
78-
- uses: actions/checkout@v7
79-
- uses: astral-sh/setup-uv@v8.2.0
83+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
84+
with:
85+
persist-credentials: false
86+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
8087
with:
8188
version-file: "requirements-tests.txt"
8289
- name: Git config
8390
run: |
8491
git config --global user.name stubsabot
8592
git config --global user.email '<>'
86-
- run: |
93+
- name: Run stubsabot
94+
run: |
8795
uv run \
8896
--python=3.13 \
8997
--no-project \

‎.github/workflows/mypy_primer.yml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run mypy_primer
1+
name: mypy_primer
22

33
on:
44
# Only run on PR, since we diff against main
@@ -25,11 +25,12 @@ jobs:
2525
shard-index: [0, 1, 2, 3, 4, 5]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v7
28+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2929
with:
3030
path: typeshed_to_test
3131
fetch-depth: 0
32-
- uses: actions/setup-python@v6
32+
persist-credentials: false
33+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
3334
with:
3435
python-version: "3.13"
3536
- name: Install dependencies
@@ -62,15 +63,15 @@ jobs:
6263
run: |
6364
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
6465
- name: Upload mypy_primer diff + PR number
65-
uses: actions/upload-artifact@v7
66+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
6667
if: ${{ matrix.shard-index == 0 }}
6768
with:
6869
name: mypy_primer_diffs-${{ matrix.shard-index }}
6970
path: |
7071
diff_${{ matrix.shard-index }}.txt
7172
pr_number.txt
7273
- name: Upload mypy_primer diff
73-
uses: actions/upload-artifact@v7
74+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
7475
if: ${{ matrix.shard-index != 0 }}
7576
with:
7677
name: mypy_primer_diffs-${{ matrix.shard-index }}
@@ -84,7 +85,7 @@ jobs:
8485
contents: read
8586
steps:
8687
- name: Merge artifacts
87-
uses: actions/upload-artifact/merge@v7
88+
uses: actions/upload-artifact/merge@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
8889
with:
8990
name: mypy_primer_diffs
9091
pattern: mypy_primer_diffs-*

‎.github/workflows/mypy_primer_comment.yml‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: Comment with mypy_primer diff
1+
name: mypy_primer (comment)
22

3-
on:
3+
# workflow_run is needed to comment on PRs from forks. This workflow only reads
4+
# artifacts as data; it never checks out or executes PR code.
5+
on: # zizmor: ignore[dangerous-triggers]
46
workflow_run:
57
workflows:
6-
- Run mypy_primer
8+
- mypy_primer
79
types:
810
- completed
911

@@ -18,7 +20,7 @@ jobs:
1820
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1921
steps:
2022
- name: Download diffs
21-
uses: actions/github-script@v9
23+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
2224
with:
2325
script: |
2426
const fs = require('fs');
@@ -44,7 +46,7 @@ jobs:
4446
4547
- name: Post comment
4648
id: post-comment
47-
uses: actions/github-script@v9
49+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
4850
with:
4951
github-token: ${{ secrets.GITHUB_TOKEN }}
5052
script: |
@@ -79,8 +81,7 @@ jobs:
7981
return prNumber
8082
8183
- name: Hide old comments
82-
# v0.4.0
83-
uses: kanga333/comment-hider@c12bb20b48aeb8fc098e35967de8d4f8018fffdf
84+
uses: kanga333/comment-hider@c12bb20b48aeb8fc098e35967de8d4f8018fffdf # v0.4.0
8485
with:
8586
github_token: ${{ secrets.GITHUB_TOKEN }}
8687
leave_visible: 1

‎.github/workflows/stubsabot.yml‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
name: Run stubsabot daily
1+
name: Stubsabot
22

33
on:
44
workflow_dispatch:
55
schedule:
66
- cron: "0 0 * * *"
77

8-
permissions:
9-
contents: write
10-
issues: write
11-
pull-requests: write
8+
permissions: {}
129

1310
env:
1411
FORCE_COLOR: 1
@@ -18,16 +15,20 @@ jobs:
1815
name: Upgrade stubs with stubsabot
1916
if: github.repository == 'python/typeshed'
2017
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
pull-requests: write # Create, update, and label PRs.
2121
steps:
22-
- uses: actions/checkout@v7
22+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 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: astral-sh/setup-uv@v8.2.0
27+
persist-credentials: true # stubsabot needs the SSH key to push branches.
28+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
2829
with:
2930
version-file: "requirements-tests.txt"
30-
- name: git config
31+
- name: Git config
3132
run: |
3233
git config --global user.name stubsabot
3334
git config --global user.email '<>'
@@ -47,8 +48,10 @@ jobs:
4748
runs-on: ubuntu-latest
4849
needs: [stubsabot]
4950
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubsabot.result == 'failure') }}
51+
permissions:
52+
issues: write
5053
steps:
51-
- uses: actions/github-script@v9
54+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
5255
with:
5356
github-token: ${{ secrets.GITHUB_TOKEN }}
5457
script: |

‎.github/workflows/stubtest_stdlib.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stdlib stubtest
1+
name: "Stubtest: stdlib"
22

33
on:
44
workflow_dispatch:
@@ -39,9 +39,11 @@ jobs:
3939
fail-fast: false
4040

4141
steps:
42-
- uses: actions/checkout@v7
42+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
43+
with:
44+
persist-credentials: false
4345
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
44-
uses: actions/setup-python@v6
46+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
4547
with:
4648
python-version: ${{ matrix.python-version }}
4749
cache: pip

‎.github/workflows/stubtest_third_party.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Third-party stubtest
1+
name: "Stubtest: third-party"
22

33
on:
44
pull_request:
@@ -36,10 +36,11 @@ jobs:
3636
fail-fast: false
3737

3838
steps:
39-
- uses: actions/checkout@v7
39+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
4040
with:
4141
fetch-depth: 0
42-
- uses: actions/setup-python@v6
42+
persist-credentials: false
43+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
4344
with:
4445
python-version: "3.13"
4546
cache: pip
@@ -54,7 +55,7 @@ jobs:
5455
# This only runs stubtest on changed stubs, because it is much faster.
5556
# Use the daily.yml workflow to run stubtest on all third party stubs.
5657
function find_stubs {
57-
git diff --name-only origin/${{ github.base_ref }} HEAD | \
58+
git diff --name-only "origin/${GITHUB_BASE_REF}" HEAD | \
5859
egrep ^stubs/ | cut -d "/" -f 2 | sort -u | \
5960
(while read stub; do [ -d "stubs/$stub" ] && echo -n "$stub " || true; done)
6061
}

0 commit comments

Comments
 (0)