Skip to content

Commit 28b0037

Browse files
authored
Merge branch 'main' into argparse
2 parents 2434fc4 + 64beb03 commit 28b0037

File tree

3,867 files changed

+91616
-60945
lines changed

Some content is hidden

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

3,867 files changed

+91616
-60945
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.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/renovate.json5

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"dependencyDashboard": true,
4+
"suppressNotifications": ["prEditedNotification"],
5+
"extends": ["config:recommended"],
6+
"labels": ["bot: dependencies"],
7+
"semanticCommits": "disabled",
8+
"separateMajorMinor": false,
9+
"prHourlyLimit": 10,
10+
// This package rule disables updates for `actions/setup-python` Python versions:
11+
// it's better to do these manually as there's often a reason why we can't use
12+
// the latest Python version in CI for a specific job
13+
ignoreDeps: ["python"],
14+
"pre-commit": {
15+
"enabled": true
16+
},
17+
"packageRules": [
18+
{
19+
groupName: "GitHub Actions",
20+
matchManagers: ["github-actions"],
21+
description: "Quarterly update of GitHub Action dependencies",
22+
schedule: ["every 3 months on the first day of the month"]
23+
},
24+
{
25+
groupName: "most test/lint dependencies",
26+
matchManagers: ["pip_requirements", "pre-commit"],
27+
matchPackageNames: ["!pyright"],
28+
description: "Quarterly update of most test dependencies",
29+
schedule: ["every 3 months on the first day of the month"]
30+
},
31+
{
32+
"groupName": "pyright",
33+
"matchManagers": ["pip_requirements"],
34+
"matchPackageNames": ["pyright"],
35+
"description": "Daily update of pyright",
36+
"schedule": ["before 4am"]
37+
}
38+
]
39+
}

.github/workflows/daily.yml

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ env:
2929

3030
jobs:
3131
stubtest-stdlib:
32-
name: Check stdlib with stubtest
33-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
32+
name: "stubtest: stdlib"
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
@@ -54,68 +54,78 @@ jobs:
5454
run: python tests/stubtest_stdlib.py
5555

5656
stubtest-third-party:
57-
name: Check third party stubs with stubtest
58-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
57+
name: "stubtest: third party"
58+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
5959
runs-on: ${{ matrix.os }}
6060
strategy:
6161
matrix:
6262
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
6363
shard-index: [0, 1, 2, 3]
6464
fail-fast: false
6565
steps:
66-
- uses: actions/checkout@v4
67-
- uses: actions/setup-python@v5
66+
- uses: actions/checkout@v5
67+
- uses: actions/setup-python@v6
6868
with:
69-
python-version: "3.12"
69+
python-version: "3.13"
7070
cache: pip
7171
cache-dependency-path: |
7272
requirements-tests.txt
7373
stubs/**/METADATA.toml
7474
- name: Install dependencies
7575
run: pip install -r requirements-tests.txt
76-
- name: Run stubtest
76+
- name: Install required system packages
7777
shell: bash
7878
run: |
7979
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
8080
8181
if [ "${{ runner.os }}" = "Linux" ]; then
8282
if [ -n "$PACKAGES" ]; then
83-
sudo apt-get update && sudo apt-get install -y $PACKAGES
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
8485
fi
85-
86-
PYTHON_EXECUTABLE="xvfb-run python"
8786
else
8887
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
88+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8989
brew install -q $PACKAGES
9090
fi
9191
9292
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
93+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
9394
choco install -y $PACKAGES
9495
fi
95-
96+
fi
97+
- name: Run stubtest
98+
shell: bash
99+
run: |
100+
if [ "${{ runner.os }}" = "Linux" ]; then
101+
PYTHON_EXECUTABLE="xvfb-run python"
102+
else
96103
PYTHON_EXECUTABLE="python"
97104
fi
98105
99-
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
106+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
100107
101108
stub-uploader:
102-
name: Run the stub_uploader tests
103-
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
109+
name: stub_uploader tests
110+
if: ${{ github.repository == 'python/typeshed' || github.event_name != 'schedule' }}
104111
runs-on: ubuntu-latest
105112
steps:
106113
- name: Checkout typeshed
107-
uses: actions/checkout@v4
114+
uses: actions/checkout@v5
108115
with:
109116
path: typeshed
110117
- name: Checkout stub_uploader
111-
uses: actions/checkout@v4
118+
uses: actions/checkout@v5
112119
with:
113120
repository: typeshed-internal/stub_uploader
114121
path: stub_uploader
115-
- uses: actions/setup-python@v5
122+
- uses: actions/setup-python@v6
123+
with:
124+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
125+
python-version: "3.13"
126+
- uses: astral-sh/setup-uv@v6
116127
with:
117-
python-version: "3.12"
118-
- uses: astral-sh/setup-uv@v5
128+
version-file: "typeshed/requirements-tests.txt"
119129
- name: Run tests
120130
run: |
121131
cd stub_uploader
@@ -124,14 +134,14 @@ jobs:
124134
125135
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
126136
create-issue-on-failure:
127-
name: Create an issue if daily tests failed
137+
name: Create issue on failure
128138
runs-on: ubuntu-latest
129139
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
130140
if: ${{ github.repository == 'python/typeshed' && always() && github.event_name == 'schedule' && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure' || needs.stub-uploader.result == 'failure') }}
131141
permissions:
132142
issues: write
133143
steps:
134-
- uses: actions/github-script@v7
144+
- uses: actions/github-script@v8
135145
with:
136146
github-token: ${{ secrets.GITHUB_TOKEN }}
137147
script: |

.github/workflows/meta_tests.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,37 @@ concurrency:
2828

2929
jobs:
3030
mypy:
31-
name: Run mypy against the scripts and tests directories
31+
name: Check scripts and tests with mypy
3232
runs-on: ubuntu-latest
3333
strategy:
3434
matrix:
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:
41-
python-version: "3.12"
42-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
41+
python-version: "3.13"
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:
46-
name: Run pyright against the scripts and tests directories
48+
name: Check scripts and tests with pyright
4749
runs-on: ubuntu-latest
4850
strategy:
4951
matrix:
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-
python-version: "3.12"
57-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
61+
version-file: "requirements-tests.txt"
5862
- run: uv pip install -r requirements-tests.txt --system
5963
- name: Run pyright on typeshed
6064
uses: jakebailey/pyright-action@v2
@@ -67,11 +71,13 @@ jobs:
6771
name: Stubsabot dry run
6872
runs-on: ubuntu-latest
6973
steps:
70-
- uses: actions/checkout@v4
71-
- uses: actions/setup-python@v5
74+
- uses: actions/checkout@v5
75+
- uses: actions/setup-python@v6
76+
with:
77+
python-version: "3.13"
78+
- uses: astral-sh/setup-uv@v6
7279
with:
73-
python-version: "3.12"
74-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
80+
version-file: "requirements-tests.txt"
7581
- name: Git config
7682
run: |
7783
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: 8 additions & 6 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:
29-
python-version: "3.12"
30-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
29+
python-version: "3.13"
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
@@ -39,12 +41,12 @@ jobs:
3941

4042
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
4143
create-issue-on-failure:
42-
name: Create an issue if stubsabot failed
44+
name: Create issue on failure
4345
runs-on: ubuntu-latest
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ concurrency:
2626

2727
jobs:
2828
stubtest-stdlib:
29-
name: Check stdlib with stubtest
29+
name: "stubtest: stdlib"
3030
runs-on: ${{ matrix.os }}
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

0 commit comments

Comments
 (0)