Skip to content

Commit 932b19b

Browse files
authored
Merge branch 'main' into uwsgi-thread-typevartuple
2 parents 4e48e1f + ecb0742 commit 932b19b

File tree

3,376 files changed

+81183
-52597
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,376 files changed

+81183
-52597
lines changed

.flake8

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
[flake8]
2-
# NQA: Ruff won't warn about redundant `# noqa: Y`
32
# Y: Flake8 is only used to run flake8-pyi, everything else is in Ruff
4-
# F821: Typeshed is a testing ground for flake8-pyi, which monkeypatches F821
5-
select = NQA, Y, F821
3+
select = Y
64
# Ignore rules normally excluded by default
7-
extend-ignore = Y090
5+
extend-ignore = Y090,Y091
86
per-file-ignores =
9-
# We should only need to noqa Y and F821 codes in .pyi files
10-
*.py: NQA
117
# Generated protobuf files:
128
# Y021: Include docstrings
139
# Y023: Alias typing as typing_extensions
@@ -16,4 +12,3 @@ per-file-ignores =
1612
stubs/*_pb2.pyi: Y021, Y023, Y026, Y053
1713

1814
exclude = .venv*,.git
19-
noqa_require_code = true

.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: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ env:
2929

3030
jobs:
3131
stubtest-stdlib:
32-
name: Check stdlib with stubtest
32+
name: "stubtest: stdlib"
3333
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
3434
runs-on: ${{ matrix.os }}
3535
strategy:
3636
matrix:
37-
# As of 2024-10-18, ubuntu-latest can refer to different Ubuntu versions,
38-
# which can can cause problems with os module constants.
39-
os: ["ubuntu-24.04", "windows-latest", "macos-latest"]
40-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
37+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
4139
fail-fast: false
4240

4341
steps:
@@ -56,23 +54,19 @@ jobs:
5654
run: python tests/stubtest_stdlib.py
5755

5856
stubtest-third-party:
59-
name: Check third party stubs with stubtest
57+
name: "stubtest: third party"
6058
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
6159
runs-on: ${{ matrix.os }}
6260
strategy:
6361
matrix:
64-
# As of 2024-10-18, ubuntu-latest can refer to different Ubuntu versions,
65-
# which causes problems when testing gdb.
66-
os: ["ubuntu-24.04", "windows-latest", "macos-latest"]
62+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
6763
shard-index: [0, 1, 2, 3]
6864
fail-fast: false
6965
steps:
7066
- uses: actions/checkout@v4
7167
- uses: actions/setup-python@v5
7268
with:
73-
# TODO: Use Python 3.12. As of 2024-03-08, several third-party
74-
# packages fail to install with Python 3.12.
75-
python-version: "3.11"
69+
python-version: "3.13"
7670
cache: pip
7771
cache-dependency-path: |
7872
requirements-tests.txt
@@ -86,7 +80,7 @@ jobs:
8680
8781
if [ "${{ runner.os }}" = "Linux" ]; then
8882
if [ -n "$PACKAGES" ]; then
89-
sudo apt-get update && sudo apt-get install -y $PACKAGES
83+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
9084
fi
9185
9286
PYTHON_EXECUTABLE="xvfb-run python"
@@ -105,7 +99,7 @@ jobs:
10599
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
106100
107101
stub-uploader:
108-
name: Run the stub_uploader tests
102+
name: stub_uploader tests
109103
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
110104
runs-on: ubuntu-latest
111105
steps:
@@ -120,8 +114,11 @@ jobs:
120114
path: stub_uploader
121115
- uses: actions/setup-python@v5
122116
with:
123-
python-version: "3.12"
124-
- uses: astral-sh/setup-uv@v5
117+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
118+
python-version: "3.13"
119+
- uses: astral-sh/setup-uv@v6
120+
with:
121+
version-file: "typeshed/requirements-tests.txt"
125122
- name: Run tests
126123
run: |
127124
cd stub_uploader
@@ -130,7 +127,7 @@ jobs:
130127
131128
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
132129
create-issue-on-failure:
133-
name: Create an issue if daily tests failed
130+
name: Create issue on failure
134131
runs-on: ubuntu-latest
135132
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
136133
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') }}

.github/workflows/meta_tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
paths:
1111
- "scripts/**"
1212
- "tests/**"
13+
- "lib/**"
1314
- ".github/workflows/meta_tests.yml"
1415
- "requirements-tests.txt"
1516
- "pyproject.toml"
@@ -27,7 +28,7 @@ concurrency:
2728

2829
jobs:
2930
mypy:
30-
name: Run mypy against the scripts and tests directories
31+
name: Check scripts and tests with mypy
3132
runs-on: ubuntu-latest
3233
strategy:
3334
matrix:
@@ -37,12 +38,12 @@ jobs:
3738
- uses: actions/checkout@v4
3839
- uses: actions/setup-python@v5
3940
with:
40-
python-version: "3.12"
41+
python-version: "3.13"
4142
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
4243
- run: uv pip install -r requirements-tests.txt --system
4344
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4445
pyright:
45-
name: Run pyright against the scripts and tests directories
46+
name: Check scripts and tests with pyright
4647
runs-on: ubuntu-latest
4748
strategy:
4849
matrix:
@@ -52,7 +53,7 @@ jobs:
5253
- uses: actions/checkout@v4
5354
- uses: actions/setup-python@v5
5455
with:
55-
python-version: "3.12"
56+
python-version: "3.13"
5657
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
5758
- run: uv pip install -r requirements-tests.txt --system
5859
- name: Run pyright on typeshed
@@ -69,7 +70,7 @@ jobs:
6970
- uses: actions/checkout@v4
7071
- uses: actions/setup-python@v5
7172
with:
72-
python-version: "3.12"
73+
python-version: "3.13"
7374
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
7475
- name: Git config
7576
run: |

.github/workflows/mypy_primer.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fetch-depth: 0
3232
- uses: actions/setup-python@v5
3333
with:
34-
python-version: "3.12"
34+
python-version: "3.13"
3535
- name: Install dependencies
3636
run: pip install git+https://github.com/hauntsaninja/mypy_primer.git
3737
- name: Run mypy_primer
@@ -57,18 +57,35 @@ jobs:
5757
--output concise \
5858
| tee diff_${{ matrix.shard-index }}.txt
5959
) || [ $? -eq 1 ]
60-
- name: Upload mypy_primer diff
61-
uses: actions/upload-artifact@v4
62-
with:
63-
name: mypy_primer_diff_${{ matrix.shard-index }}
64-
path: diff_${{ matrix.shard-index }}.txt
6560
- if: ${{ matrix.shard-index == 0 }}
6661
name: Save PR number
6762
run: |
6863
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
69-
- if: ${{ matrix.shard-index == 0 }}
70-
name: Upload PR number
64+
- name: Upload mypy_primer diff + PR number
7165
uses: actions/upload-artifact@v4
66+
if: ${{ matrix.shard-index == 0 }}
67+
with:
68+
name: mypy_primer_diffs-${{ matrix.shard-index }}
69+
path: |
70+
diff_${{ matrix.shard-index }}.txt
71+
pr_number.txt
72+
- name: Upload mypy_primer diff
73+
uses: actions/upload-artifact@v4
74+
if: ${{ matrix.shard-index != 0 }}
75+
with:
76+
name: mypy_primer_diffs-${{ matrix.shard-index }}
77+
path: diff_${{ matrix.shard-index }}.txt
78+
79+
join_artifacts:
80+
name: Join artifacts
81+
runs-on: ubuntu-latest
82+
needs: [mypy_primer]
83+
permissions:
84+
contents: read
85+
steps:
86+
- name: Merge artifacts
87+
uses: actions/upload-artifact/merge@v4
7288
with:
73-
name: mypy_primer_diff_pr_number
74-
path: pr_number.txt
89+
name: mypy_primer_diffs
90+
pattern: mypy_primer_diffs-*
91+
delete-merged: true

.github/workflows/mypy_primer_comment.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Post mypy_primer comment
1+
name: Comment with mypy_primer diff
22

33
on:
44
workflow_run:
@@ -14,8 +14,8 @@ permissions:
1414
jobs:
1515
comment:
1616
name: Comment PR from mypy_primer
17-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1817
runs-on: ubuntu-latest
18+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1919
steps:
2020
- name: Download diffs
2121
uses: actions/github-script@v7
@@ -27,28 +27,26 @@ jobs:
2727
repo: context.repo.repo,
2828
run_id: ${{ github.event.workflow_run.id }},
2929
});
30-
const matchArtifacts = artifacts.data.artifacts.filter((artifact) =>
31-
artifact.name.startsWith("mypy_primer_diff"));
30+
const [matchArtifact] = artifacts.data.artifacts.filter((artifact) =>
31+
artifact.name == "mypy_primer_diffs");
3232
33-
for (const matchArtifact of matchArtifacts) {
34-
const download = await github.rest.actions.downloadArtifact({
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
artifact_id: matchArtifact.id,
38-
archive_format: "zip",
39-
});
40-
fs.writeFileSync(`${matchArtifact.name}.zip`, Buffer.from(download.data));
41-
}
33+
const download = await github.rest.actions.downloadArtifact({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
artifact_id: matchArtifact.id,
37+
archive_format: "zip",
38+
});
39+
fs.writeFileSync("diff.zip", Buffer.from(download.data));
4240
43-
- run: for file in *.zip; do unzip $file; done
41+
- run: unzip diff.zip
4442
- run: |
4543
cat diff_*.txt | tee fulldiff.txt
4644
4745
- name: Post comment
4846
id: post-comment
4947
uses: actions/github-script@v7
5048
with:
51-
github-token: ${{secrets.GITHUB_TOKEN}}
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
5250
script: |
5351
const fs = require('fs')
5452
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
@@ -61,6 +59,9 @@ jobs:
6159
data = truncated_data + `\n\n... (truncated ${lines_truncated} lines) ...\n`
6260
}
6361
62+
console.log("Diff from mypy_primer:")
63+
console.log(data)
64+
6465
let body
6566
if (data.trim()) {
6667
body = 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n```diff\n' + data + '```'

.github/workflows/stubsabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fetch-depth: 0
2727
- uses: actions/setup-python@v5
2828
with:
29-
python-version: "3.12"
29+
python-version: "3.13"
3030
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
3131
- name: git config
3232
run: |
@@ -39,7 +39,7 @@ jobs:
3939

4040
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
4141
create-issue-on-failure:
42-
name: Create an issue if stubsabot failed
42+
name: Create issue on failure
4343
runs-on: ubuntu-latest
4444
needs: [stubsabot]
4545
if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubsabot.result == 'failure') }}

.github/workflows/stubtest_stdlib.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ 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:
33-
# As of 2024-10-18, ubuntu-latest can refer to different Ubuntu versions,
34-
# which can can cause problems with os module constants.
35-
os: ["ubuntu-24.04", "windows-latest", "macos-latest"]
36-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
33+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
34+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
3735
fail-fast: false
3836

3937
steps:

0 commit comments

Comments
 (0)