Skip to content

Commit f9d5875

Browse files
committed
Merge branch 'main' into datetime-tzinfo
2 parents b148970 + 4239e94 commit f9d5875

File tree

4,990 files changed

+144261
-87674
lines changed

Some content is hidden

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

4,990 files changed

+144261
-87674
lines changed

.flake8

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +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
11-
# Ignore Y052 in this file: there are loads of false positives
12-
# due to the fact that flake8-pyi doesn't understand subclasses of `CoerciveEnum`
13-
# as being enum classes
14-
stubs/fpdf2/fpdf/enums.pyi: Y052
157
# Generated protobuf files:
168
# Y021: Include docstrings
179
# Y023: Alias typing as typing_extensions
@@ -20,4 +12,3 @@ per-file-ignores =
2012
stubs/*_pb2.pyi: Y021, Y023, Y026, Y053
2113

2214
exclude = .venv*,.git
23-
noqa_require_code = true

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* eol=lf
44
# Set linguist-language to support comments syntax highlight
55
**/stubtest_allowlist*.txt linguist-language=ini
6-
tests/stubtest_allowlists/*.txt linguist-language=ini
7-
tests/pytype_exclude_list.txt linguist-language=ini
6+
**/stubtest_allowlists/*.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: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +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:
37-
# tkinter doesn't import on macOS-12
38-
os: ["ubuntu-latest", "windows-latest", "macos-11"]
39-
# TODO unpin the 3.11 and 3.12 micro versions
40-
python-version: ["3.8", "3.9", "3.10", "3.11.8", "3.12.2"]
37+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
4139
fail-fast: false
4240

4341
steps:
44-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
4543
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
46-
uses: actions/setup-python@v5
44+
uses: actions/setup-python@v6
4745
with:
4846
python-version: ${{ matrix.python-version }}
4947
cache: pip
@@ -56,71 +54,78 @@ jobs:
5654
run: python tests/stubtest_stdlib.py
5755

5856
stubtest-third-party:
59-
name: Check third party stubs with stubtest
60-
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' }}
6159
runs-on: ${{ matrix.os }}
6260
strategy:
6361
matrix:
6462
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
6563
shard-index: [0, 1, 2, 3]
6664
fail-fast: false
6765
steps:
68-
- uses: actions/checkout@v4
69-
- uses: actions/setup-python@v5
66+
- uses: actions/checkout@v5
67+
- uses: actions/setup-python@v6
7068
with:
71-
# TODO: Use Python 3.12. As of 2024-03-08, several third-party
72-
# packages fail to install with Python 3.12.
73-
python-version: "3.11"
69+
python-version: "3.13"
7470
cache: pip
7571
cache-dependency-path: |
7672
requirements-tests.txt
7773
stubs/**/METADATA.toml
7874
- name: Install dependencies
7975
run: pip install -r requirements-tests.txt
80-
- name: Run stubtest
76+
- name: Install required system packages
8177
shell: bash
8278
run: |
8379
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
8480
8581
if [ "${{ runner.os }}" = "Linux" ]; then
8682
if [ -n "$PACKAGES" ]; then
87-
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
8885
fi
89-
90-
PYTHON_EXECUTABLE="xvfb-run python"
9186
else
9287
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
93-
brew install $PACKAGES
88+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
89+
brew install -q $PACKAGES
9490
fi
9591
9692
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
93+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
9794
choco install -y $PACKAGES
9895
fi
99-
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
100103
PYTHON_EXECUTABLE="python"
101104
fi
102105
103-
$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 }}
104107
105108
stub-uploader:
106-
name: Run the stub_uploader tests
107-
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' }}
108111
runs-on: ubuntu-latest
109112
steps:
110113
- name: Checkout typeshed
111-
uses: actions/checkout@v4
114+
uses: actions/checkout@v5
112115
with:
113116
path: typeshed
114117
- name: Checkout stub_uploader
115-
uses: actions/checkout@v4
118+
uses: actions/checkout@v5
116119
with:
117120
repository: typeshed-internal/stub_uploader
118121
path: stub_uploader
119-
- 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
120127
with:
121-
python-version: "3.12"
122-
- name: Install uv
123-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
128+
version-file: "typeshed/requirements-tests.txt"
124129
- name: Run tests
125130
run: |
126131
cd stub_uploader
@@ -129,21 +134,21 @@ jobs:
129134
130135
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
131136
create-issue-on-failure:
132-
name: Create an issue if daily tests failed
137+
name: Create issue on failure
133138
runs-on: ubuntu-latest
134139
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
135-
if: ${{ github.repository == 'python/typeshed' && always() && github.event_name != 'pull_request' && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure' || needs.stub-uploader.result == 'failure') }}
140+
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') }}
136141
permissions:
137142
issues: write
138143
steps:
139-
- uses: actions/github-script@v7
144+
- uses: actions/github-script@v8
140145
with:
141146
github-token: ${{ secrets.GITHUB_TOKEN }}
142147
script: |
143148
await github.rest.issues.create({
144149
owner: "python",
145150
repo: "typeshed",
146151
title: `Daily tests failed on ${new Date().toDateString()}`,
147-
body: "Runs listed here: https://github.com/python/typeshed/actions/workflows/daily.yml",
152+
body: "Run listed here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
148153
labels: ["help wanted"],
149154
})

.github/workflows/meta_tests.yml

Lines changed: 22 additions & 16 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,51 +28,56 @@ 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:
3435
platform: ["linux", "win32"]
3536
fail-fast: false
3637
steps:
37-
- uses: actions/checkout@v4
38-
- uses: actions/setup-python@v5
38+
- uses: actions/checkout@v5
39+
- uses: actions/setup-python@v6
3940
with:
40-
python-version: "3.12"
41-
- 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"
4245
- run: uv pip install -r requirements-tests.txt --system
4346
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4447
pyright:
45-
name: Run pyright against the scripts and tests directories
48+
name: Check scripts and tests with pyright
4649
runs-on: ubuntu-latest
4750
strategy:
4851
matrix:
4952
python-platform: ["Linux", "Windows"]
5053
fail-fast: false
5154
steps:
52-
- uses: actions/checkout@v4
53-
- 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
5460
with:
55-
# Max supported Python version as of pytype 2024.2.27.
56-
python-version: "3.11"
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
6165
with:
6266
version: PATH
6367
python-platform: ${{ matrix.python-platform }}
64-
python-version: "3.9" # The Python version to test against.
68+
python-version: "3.9" # Oldest version supported for running scripts and tests
6569
project: ./pyrightconfig.scripts_and_tests.json
6670
stubsabot-dry-run:
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

0 commit comments

Comments
 (0)