Skip to content

Commit bf4a315

Browse files
committed
Merge branch 'main' of https://github.com/python/typeshed into try-out-setup-uv
2 parents 72920d0 + 1c17cd4 commit bf4a315

File tree

1,076 files changed

+20842
-28207
lines changed

Some content is hidden

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

1,076 files changed

+20842
-28207
lines changed

.github/renovate.json

-35
This file was deleted.

.github/renovate.json5

+39
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: ["!pytype", "!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": "pytype and pyright",
33+
"matchManagers": ["pip_requirements"],
34+
"matchPackageNames": ["pytype", "pyright"],
35+
"description": "Daily update of pyright and pytype",
36+
"schedule": ["before 4am"]
37+
}
38+
]
39+
}

.github/workflows/daily.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ 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:
@@ -54,7 +54,7 @@ jobs:
5454
run: python tests/stubtest_stdlib.py
5555

5656
stubtest-third-party:
57-
name: Check third party stubs with stubtest
57+
name: "stubtest: third party"
5858
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
5959
runs-on: ${{ matrix.os }}
6060
strategy:
@@ -66,7 +66,7 @@ jobs:
6666
- uses: actions/checkout@v4
6767
- uses: astral-sh/setup-uv@v5
6868
with:
69-
python-version: "3.12"
69+
python-version: "3.13"
7070
enable-cache: true
7171
prune-cache: false # Can't prune cache if uv installs uv
7272
cache-dependency-glob: |
@@ -81,7 +81,7 @@ jobs:
8181
8282
if [ "${{ runner.os }}" = "Linux" ]; then
8383
if [ -n "$PACKAGES" ]; then
84-
sudo apt-get update && sudo apt-get install -y $PACKAGES
84+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
8585
fi
8686
8787
PYTHON_EXECUTABLE="xvfb-run python"
@@ -100,7 +100,7 @@ jobs:
100100
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
101101
102102
stub-uploader:
103-
name: Run the stub_uploader tests
103+
name: stub_uploader tests
104104
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
105105
runs-on: ubuntu-latest
106106
steps:
@@ -115,7 +115,8 @@ jobs:
115115
path: stub_uploader
116116
- uses: astral-sh/setup-uv@v5
117117
with:
118-
python-version: "3.12"
118+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
119+
python-version: "3.13"
119120
- uses: astral-sh/setup-uv@v5
120121
- name: Run tests
121122
run: |
@@ -125,7 +126,7 @@ jobs:
125126
126127
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
127128
create-issue-on-failure:
128-
name: Create an issue if daily tests failed
129+
name: Create issue on failure
129130
runs-on: ubuntu-latest
130131
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
131132
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

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ 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:
@@ -38,11 +38,11 @@ jobs:
3838
- uses: actions/checkout@v4
3939
- uses: astral-sh/setup-uv@v5
4040
with:
41-
python-version: "3.12"
41+
python-version: "3.13"
4242
- run: uv pip install -r requirements-tests.txt
4343
- run: uv run --no-project ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4444
pyright:
45-
name: Run pyright against the scripts and tests directories
45+
name: Check scripts and tests with pyright
4646
runs-on: ubuntu-latest
4747
strategy:
4848
matrix:
@@ -52,6 +52,8 @@ jobs:
5252
- uses: actions/checkout@v4
5353
- uses: astral-sh/setup-uv@v5
5454
with:
55+
# TODO: Since pytype is not available for Python 3.13, and
56+
# pytype_test.py imports pytype, we need to use Python 3.12 for now.
5557
python-version: "3.12"
5658
prune-cache: false # Can't prune cache if uv installs uv
5759
- run: uv pip install -r requirements-tests.txt
@@ -69,7 +71,7 @@ jobs:
6971
- uses: actions/checkout@v4
7072
- uses: astral-sh/setup-uv@v5
7173
with:
72-
python-version: "3.12"
74+
python-version: "3.13"
7375
- name: Git config
7476
run: |
7577
git config --global user.name stubsabot

.github/workflows/stubsabot.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fetch-depth: 0
2727
- uses: astral-sh/setup-uv@v5
2828
with:
29-
python-version: "3.12"
29+
python-version: "3.13"
3030
- name: git config
3131
run: |
3232
git config --global user.name stubsabot
@@ -38,7 +38,7 @@ jobs:
3838

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

.github/workflows/stubtest_stdlib.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ 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:

.github/workflows/stubtest_third_party.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ concurrency:
2727

2828
jobs:
2929
stubtest-third-party:
30-
name: Check third party stubs with stubtest
30+
name: "stubtest: third party"
3131

3232
runs-on: ${{ matrix.os }}
3333
strategy:
@@ -41,7 +41,7 @@ jobs:
4141
fetch-depth: 0
4242
- uses: astral-sh/setup-uv@v5
4343
with:
44-
python-version: "3.12"
44+
python-version: "3.13"
4545
enable-cache: true
4646
prune-cache: false # Can't prune cache if uv installs uv
4747
cache-dependency-glob: |
@@ -68,7 +68,7 @@ jobs:
6868
if [ "${{ runner.os }}" = "Linux" ]; then
6969
if [ -n "$PACKAGES" ]; then
7070
echo "Installing apt packages: $PACKAGES"
71-
sudo apt-get update && sudo apt-get install -y $PACKAGES
71+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
7272
fi
7373
7474
PYTHON_EXECUTABLE="xvfb-run python"

.github/workflows/tests.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ jobs:
2929
- uses: actions/checkout@v4
3030
- uses: astral-sh/setup-uv@v5
3131
with:
32-
python-version: "3.12"
32+
python-version: "3.13"
3333
- run: uv pip install -r requirements-tests.txt
3434
- run: uv run --no-project ./tests/check_typeshed_structure.py
3535

3636
pytype:
37-
name: Run pytype against the stubs
37+
name: "pytype: Check stubs"
3838
runs-on: ubuntu-latest
3939
steps:
4040
- uses: actions/checkout@v4
4141
- uses: astral-sh/setup-uv@v5
4242
with:
43-
# Max supported Python version as of pytype 2024.9.13
43+
# Max supported Python version as of pytype 2024.10.11
4444
python-version: "3.12"
4545
- uses: astral-sh/setup-uv@v5
4646
- run: uv pip install -r requirements-tests.txt
@@ -55,7 +55,7 @@ jobs:
5555
- run: ./tests/pytype_test.py --print-stderr
5656

5757
mypy:
58-
name: Run mypy against the stubs
58+
name: "mypy: Check stubs"
5959
runs-on: ubuntu-latest
6060
strategy:
6161
matrix:
@@ -71,7 +71,7 @@ jobs:
7171
- run: uv run --no-project ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }}
7272

7373
regression-tests:
74-
name: Run mypy on the test cases
74+
name: "mypy: Run test cases"
7575
runs-on: ubuntu-latest
7676
steps:
7777
- uses: actions/checkout@v4
@@ -84,7 +84,7 @@ jobs:
8484
- run: uv run --no-project ./tests/regr_test.py --all --verbosity QUIET
8585

8686
pyright:
87-
name: Test typeshed with pyright
87+
name: "pyright: Run test cases"
8888
runs-on: ubuntu-latest
8989
strategy:
9090
matrix:
@@ -95,7 +95,7 @@ jobs:
9595
- uses: actions/checkout@v4
9696
- uses: astral-sh/setup-uv@v5
9797
with:
98-
python-version: "3.12"
98+
python-version: "3.13"
9999
- uses: astral-sh/setup-uv@v5
100100
- name: Install typeshed test-suite requirements
101101
# Install these so we can run `get_external_stub_requirements.py`
@@ -115,26 +115,26 @@ jobs:
115115
version: PATH
116116
python-platform: ${{ matrix.python-platform }}
117117
python-version: ${{ matrix.python-version }}
118-
annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
118+
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
119119
- name: Run pyright with stricter settings on some of the stubs
120120
uses: jakebailey/pyright-action@v2
121121
with:
122122
version: PATH
123123
python-platform: ${{ matrix.python-platform }}
124124
python-version: ${{ matrix.python-version }}
125-
annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
125+
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
126126
project: ./pyrightconfig.stricter.json
127127
- name: Run pyright on the test cases
128128
uses: jakebailey/pyright-action@v2
129129
with:
130130
version: PATH
131131
python-platform: ${{ matrix.python-platform }}
132132
python-version: ${{ matrix.python-version }}
133-
annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
133+
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
134134
project: ./pyrightconfig.testcases.json
135135

136136
stub-uploader:
137-
name: Run the stub_uploader tests
137+
name: stub_uploader tests
138138
runs-on: ubuntu-latest
139139
steps:
140140
- name: Checkout typeshed
@@ -148,7 +148,8 @@ jobs:
148148
path: stub_uploader
149149
- uses: astral-sh/setup-uv@v5
150150
with:
151-
python-version: "3.12"
151+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
152+
python-version: "3.13"
152153
- uses: astral-sh/setup-uv@v5
153154
- name: Run tests
154155
run: |

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ analyze.py
6868
# Mypy cache
6969
.mypy_cache/
7070

71-
# pyenv local python version
71+
# pyenv and uv local python version
7272
.python-version
73+
# we don't use uv's lock as we're not actually a project
74+
uv.lock
7375

7476
# deliberately local test configuration files
7577
stdlib/@tests/stubtest_allowlists/*.local

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
args: [--fix=lf]
1212
- id: check-case-conflict
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.9.3 # must match requirements-tests.txt
14+
rev: v0.11.2 # must match requirements-tests.txt
1515
hooks:
1616
- id: ruff
1717
name: Run ruff on stubs, tests and scripts
@@ -31,7 +31,7 @@ repos:
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/pycqa/flake8
34-
rev: 7.1.2
34+
rev: 7.2.0
3535
hooks:
3636
- id: flake8
3737
language: python

0 commit comments

Comments
 (0)