Skip to content

Commit 293f2fe

Browse files
committed
Merge branch 'main' of https://github.com/python/typeshed into removing-setuptools._distutils
2 parents aaf69e2 + bf8d2a9 commit 293f2fe

File tree

805 files changed

+4425
-16689
lines changed

Some content is hidden

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

805 files changed

+4425
-16689
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
"description": "Quarterly update of GitHub Action dependencies",
1818
"schedule": ["every 3 months on the first day of the month"]
1919
},
20+
{
21+
// This package rule disables updates for `actions/setup-python` Python versions:
22+
// it's better to do these manually as there's often a reason why we can't use
23+
// the latest Python version in CI for a specific job
24+
groupName: "Python versions",
25+
matchManagers: ["github-actions"],
26+
matchPackageNames: ["python"],
27+
description: "Disable PRs updating Python versions",
28+
enabled: false,
29+
},
2030
{
2131
"groupName": "most test/lint dependencies",
2232
"matchManagers": ["pip_requirements", "pre-commit"],

.github/workflows/daily.yml

Lines changed: 8 additions & 7 deletions
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: actions/setup-python@v5
6868
with:
69-
python-version: "3.12"
69+
python-version: "3.13"
7070
cache: pip
7171
cache-dependency-path: |
7272
requirements-tests.txt
@@ -80,7 +80,7 @@ jobs:
8080
8181
if [ "${{ runner.os }}" = "Linux" ]; then
8282
if [ -n "$PACKAGES" ]; then
83-
sudo apt-get update && sudo apt-get install -y $PACKAGES
83+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
8484
fi
8585
8686
PYTHON_EXECUTABLE="xvfb-run python"
@@ -99,7 +99,7 @@ jobs:
9999
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
100100
101101
stub-uploader:
102-
name: Run the stub_uploader tests
102+
name: stub_uploader tests
103103
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
104104
runs-on: ubuntu-latest
105105
steps:
@@ -114,7 +114,8 @@ jobs:
114114
path: stub_uploader
115115
- uses: actions/setup-python@v5
116116
with:
117-
python-version: "3.12"
117+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
118+
python-version: "3.13"
118119
- uses: astral-sh/setup-uv@v5
119120
- name: Run tests
120121
run: |
@@ -124,7 +125,7 @@ jobs:
124125
125126
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
126127
create-issue-on-failure:
127-
name: Create an issue if daily tests failed
128+
name: Create issue on failure
128129
runs-on: ubuntu-latest
129130
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
130131
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 & 4 deletions
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,12 +38,12 @@ jobs:
3838
- uses: actions/checkout@v4
3939
- uses: actions/setup-python@v5
4040
with:
41-
python-version: "3.12"
41+
python-version: "3.13"
4242
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
4343
- run: uv pip install -r requirements-tests.txt --system
4444
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4545
pyright:
46-
name: Run pyright against the scripts and tests directories
46+
name: Check scripts and tests with pyright
4747
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
@@ -53,6 +53,8 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- uses: actions/setup-python@v5
5555
with:
56+
# TODO: Since pytype is not available for Python 3.13, and
57+
# pytype_test.py imports pytype, we need to use Python 3.12 for now.
5658
python-version: "3.12"
5759
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
5860
- run: uv pip install -r requirements-tests.txt --system
@@ -70,7 +72,7 @@ jobs:
7072
- uses: actions/checkout@v4
7173
- uses: actions/setup-python@v5
7274
with:
73-
python-version: "3.12"
75+
python-version: "3.13"
7476
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
7577
- name: Git config
7678
run: |

.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: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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: actions/setup-python@v5
4343
with:
44-
python-version: "3.12"
44+
python-version: "3.13"
4545
cache: pip
4646
cache-dependency-path: |
4747
requirements-tests.txt
@@ -67,7 +67,7 @@ jobs:
6767
if [ "${{ runner.os }}" = "Linux" ]; then
6868
if [ -n "$PACKAGES" ]; then
6969
echo "Installing apt packages: $PACKAGES"
70-
sudo apt-get update && sudo apt-get install -y $PACKAGES
70+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
7171
fi
7272
7373
PYTHON_EXECUTABLE="xvfb-run python"

.github/workflows/tests.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ jobs:
2929
- uses: actions/checkout@v4
3030
- uses: actions/setup-python@v5
3131
with:
32-
python-version: "3.12"
32+
python-version: "3.13"
3333
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
3434
- run: uv pip install -r requirements-tests.txt --system
3535
- run: python ./tests/check_typeshed_structure.py
3636

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

5858
mypy:
59-
name: Run mypy against the stubs
59+
name: "mypy: Check stubs"
6060
runs-on: ubuntu-latest
6161
strategy:
6262
matrix:
@@ -73,7 +73,7 @@ jobs:
7373
- run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }}
7474

7575
regression-tests:
76-
name: Run mypy on the test cases
76+
name: "mypy: Run test cases"
7777
runs-on: ubuntu-latest
7878
steps:
7979
- uses: actions/checkout@v4
@@ -87,7 +87,7 @@ jobs:
8787
- run: python ./tests/regr_test.py --all --verbosity QUIET
8888

8989
pyright:
90-
name: Test typeshed with pyright
90+
name: "pyright: Run test cases"
9191
runs-on: ubuntu-latest
9292
strategy:
9393
matrix:
@@ -98,7 +98,7 @@ jobs:
9898
- uses: actions/checkout@v4
9999
- uses: actions/setup-python@v5
100100
with:
101-
python-version: "3.12"
101+
python-version: "3.13"
102102
- uses: astral-sh/setup-uv@v5
103103
- name: Install typeshed test-suite requirements
104104
# Install these so we can run `get_external_stub_requirements.py`
@@ -122,26 +122,26 @@ jobs:
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
- name: Run pyright with stricter settings on some of the stubs
127127
uses: jakebailey/pyright-action@v2
128128
with:
129129
version: PATH
130130
python-platform: ${{ matrix.python-platform }}
131131
python-version: ${{ matrix.python-version }}
132-
annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
132+
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
133133
project: ./pyrightconfig.stricter.json
134134
- name: Run pyright on the test cases
135135
uses: jakebailey/pyright-action@v2
136136
with:
137137
version: PATH
138138
python-platform: ${{ matrix.python-platform }}
139139
python-version: ${{ matrix.python-version }}
140-
annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
140+
annotate: ${{ matrix.python-version == '3.13' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
141141
project: ./pyrightconfig.testcases.json
142142

143143
stub-uploader:
144-
name: Run the stub_uploader tests
144+
name: stub_uploader tests
145145
runs-on: ubuntu-latest
146146
steps:
147147
- name: Checkout typeshed
@@ -155,7 +155,8 @@ jobs:
155155
path: stub_uploader
156156
- uses: actions/setup-python@v5
157157
with:
158-
python-version: "3.12"
158+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
159+
python-version: "3.13"
159160
- uses: astral-sh/setup-uv@v5
160161
- name: Run tests
161162
run: |

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
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

CONTRIBUTING.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -462,33 +462,6 @@ steps:
462462
If feeling kindly, please update [mypy](https://github.com/python/mypy/blob/master/mypy/stubinfo.py)
463463
for any stub obsoletions or removals.
464464

465-
## Maintainer guidelines
466-
467-
The process for preparing and submitting changes also applies to
468-
maintainers. This ensures high quality contributions and keeps
469-
everybody on the same page. Avoid direct pushes to the repository.
470-
471-
When reviewing pull requests, follow these guidelines:
472-
473-
* Typing is hard. Try to be helpful and explain issues with the PR,
474-
especially to new contributors.
475-
* When reviewing auto-generated stubs, just scan for red flags and obvious
476-
errors. Leave possible manual improvements for separate PRs.
477-
* When reviewing large, hand-crafted PRs, you only need to look for red flags
478-
and general issues, and do a few spot checks.
479-
* Review smaller, hand-crafted PRs thoroughly.
480-
481-
When merging pull requests, follow these guidelines:
482-
483-
* Always wait for tests to pass before merging PRs.
484-
* Use "[Squash and merge](https://github.com/blog/2141-squash-your-commits)" to merge PRs.
485-
* Make sure the commit message is meaningful. For example, remove irrelevant
486-
intermediate commit messages.
487-
* The commit message for third-party stubs is used to generate the changelog.
488-
It should be valid Markdown, be comprehensive, read like a changelog entry,
489-
and assume that the reader has no access to the diff.
490-
* Delete branches for merged PRs (by maintainers pushing to the main repo).
491-
492465
### Marking PRs as "deferred"
493466

494467
We sometimes use the ["status: deferred" label](https://github.com/python/typeshed/labels/status%3A%20deferred)
@@ -500,25 +473,9 @@ external factor. Blockers can include:
500473
- A dependency on a typing PEP that is still under consideration.
501474
- A pending change in a related project, such as stub-uploader.
502475

503-
PRs should only be marked as "deferred" if there is a clear path towards getting
504-
the blocking issue resolved within a reasonable time frame. If a PR depends on
505-
a more amorphous change, such as a type system change that has not yet reached
506-
the PEP stage, it should instead be closed.
507-
508-
Maintainers who add the "deferred" label should state clearly what exactly the
509-
blocker is, usually with a link to an open issue in another project.
510-
511476
### Closing stale PRs
512477

513478
To keep the number of open PRs manageable, we may close PRs when they have been
514479
open for too long. Specifically, we close open PRs that either have failures in CI,
515480
serious merge conflicts or unaddressed feedback, and that have not seen any
516481
activity in three months.
517-
518-
We want to maintain a welcoming atmosphere for contributors, so use a friendly
519-
message when closing the PR. Example message:
520-
521-
Thanks for contributing! I'm closing this PR for now, because it still
522-
<fails some tests OR has unresolved review feedback OR has a merge conflict>
523-
after three months of inactivity. If you are still interested, please feel free to open
524-
a new PR (or ping us to reopen this one).

0 commit comments

Comments
 (0)