Skip to content

Commit 1bebecf

Browse files
Merge branch 'main' into patch-4
2 parents 3b645bf + 955cdf5 commit 1bebecf

File tree

2,347 files changed

+55402
-21023
lines changed

Some content is hidden

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

2,347 files changed

+55402
-21023
lines changed

.editorconfig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
root = true
22

3-
[*.{py,pyi,rst,md,yml,yaml,toml,json,txt}]
3+
[*]
44
trim_trailing_whitespace = true
55
insert_final_newline = true
66
indent_style = space
7+
end_of_line = lf
8+
indent_size = 2
9+
10+
[*.md]
11+
max_line_length = 79
12+
trim_trailing_whitespace = false
713

814
[*.{py,pyi,toml,json}]
15+
max_line_length = 130
916
indent_size = 4
10-
11-
[*.{yml,yaml}]
12-
indent_size = 2

.flake8

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
# RST flake8-rst-docstrings
99
# TYP flake8-typing-imports
1010

11-
# The following rules are incompatible with or enforced by black:
11+
# The following rules are incompatible with or enforced by Black:
1212
# E203 whitespace before ':' -- scripts only
1313
# E301 expected 1 blank line
1414
# E302 expected 2 blank lines
1515
# E305 expected 2 blank lines
1616
# E501 line too long
17+
# E701 Multiple statements on one line (colon) -- disallows "..." on the same line
1718

1819
# Some rules are considered irrelevant to stub files:
1920
# B All flake8-bugbear rules are .py-specific
20-
# E701 multiple statements on one line (colon) -- disallows "..." on the same line
2121
# F401 imported but unused -- does not recognize re-exports
2222
# https://github.com/PyCQA/pyflakes/issues/474
2323

@@ -27,19 +27,18 @@
2727
# F405 defined from star imports
2828

2929
[flake8]
30-
extend-ignore = A, D, N8, SIM, RST, TYP, E301, E302, E305, E501
30+
extend-ignore = A, D, N8, SIM, RST, TYP, E301, E302, E305, E501, E701
3131
per-file-ignores =
3232
*.py: E203
33-
*.pyi: B, E701, E741, F401, F403, F405
34-
# Since typing.pyi defines "overload" this is not recognized by flake8 as typing.overload.
35-
# Unfortunately, flake8 does not allow to "noqa" just a specific error inside the file itself.
33+
*.pyi: B, E741, F401, F403, F405
34+
# Since typing.pyi defines "overload" this is not recognized by Flake8 as typing.overload.
35+
# Unfortunately, Flake8 does not allow to "noqa" just a specific error inside the file itself.
3636
# https://github.com/PyCQA/flake8/issues/1079
3737
# F811 redefinition of unused '...'
38-
stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811
39-
# Generated protobuf files include docstrings
40-
# *_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y026, Y053, Y054
38+
stdlib/typing.pyi: B, E741, F401, F403, F405, F811
39+
# Generated protobuf files include docstrings,
40+
# and import some things from typing_extensions that could be imported from typing
41+
*_pb2.pyi: B, E741, F401, F403, F405, Y021, Y023, Y026, Y053, Y054
4142

42-
# TODO: Re-enable flake8 on generated protobuf files
43-
# after https://github.com/nipunn1313/mypy-protobuf/issues/523 is resolved
44-
exclude = .venv*,.git,*_pb2.pyi
43+
exclude = .venv*,.git
4544
noqa_require_code = true

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Normalize EOF
2+
* autocrlf=false
3+
* eol=lf
14
# Set linguist-language to support comments syntax highlight
25
**/stubtest_allowlist*.txt linguist-language=ini
36
tests/stubtest_allowlists/*.txt linguist-language=ini

.github/workflows/daily.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,19 @@ jobs:
3636
matrix:
3737
# tkinter doesn't import on macOS-12
3838
os: ["ubuntu-latest", "windows-latest", "macos-11"]
39-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
39+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
4040
fail-fast: false
4141

4242
steps:
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
45-
if: ${{ matrix.os != 'macos-11' || matrix.python-version != '3.7' }}
4645
uses: actions/setup-python@v4
4746
with:
4847
python-version: ${{ matrix.python-version }}
4948
cache: pip
5049
cache-dependency-path: requirements-tests.txt
5150
allow-prereleases: true
52-
# Handle the py37 run on macos differently,
53-
# to workaround https://github.com/actions/setup-python/issues/682
54-
- name: Setup Python 3.7.16 on macos
55-
if: ${{ matrix.os == 'macos-11' && matrix.python-version == '3.7' }}
56-
uses: actions/setup-python@v4
57-
with:
58-
python-version: "3.7.16"
59-
cache: pip
60-
cache-dependency-path: requirements-tests.txt
51+
check-latest: true
6152
- name: Install dependencies
6253
run: pip install -r requirements-tests.txt
6354
- name: Run stubtest
@@ -73,7 +64,7 @@ jobs:
7364
shard-index: [0, 1, 2, 3]
7465
fail-fast: false
7566
steps:
76-
- uses: actions/checkout@v3
67+
- uses: actions/checkout@v4
7768
- uses: actions/setup-python@v4
7869
with:
7970
python-version: "3.10"
@@ -107,23 +98,24 @@ jobs:
10798
fi
10899
109100
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
101+
110102
stub-uploader:
111103
name: Run the stub_uploader tests
104+
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}
112105
runs-on: ubuntu-latest
113106
steps:
114-
- uses: actions/checkout@v3
115107
- name: Checkout typeshed
116-
uses: actions/checkout@v3
108+
uses: actions/checkout@v4
117109
with:
118110
path: typeshed
119111
- name: Checkout stub_uploader
120-
uses: actions/checkout@v3
112+
uses: actions/checkout@v4
121113
with:
122114
repository: typeshed-internal/stub_uploader
123115
path: stub_uploader
124116
- uses: actions/setup-python@v4
125117
with:
126-
python-version: "3.10"
118+
python-version: "3.11"
127119
cache: pip
128120
cache-dependency-path: stub_uploader/requirements.txt
129121
- name: Run tests

.github/workflows/typecheck_typeshed_code.yml renamed to .github/workflows/meta_tests.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Typecheck-typeshed-code
1+
# This workflow is for testing typeshed's scripts and tests themselves
2+
name: Meta-tests
23

34
on:
45
workflow_dispatch:
@@ -9,8 +10,9 @@ on:
910
paths:
1011
- "scripts/**"
1112
- "tests/**"
12-
- ".github/workflows/typecheck_typeshed_code.yml"
13+
- ".github/workflows/meta_tests.yml"
1314
- "requirements-tests.txt"
15+
- "pyproject.toml"
1416

1517
permissions:
1618
contents: read
@@ -32,7 +34,7 @@ jobs:
3234
platform: ["linux", "win32"]
3335
fail-fast: false
3436
steps:
35-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3638
- uses: actions/setup-python@v4
3739
with:
3840
python-version: "3.11"
@@ -48,7 +50,7 @@ jobs:
4850
python-platform: ["Linux", "Windows"]
4951
fail-fast: false
5052
steps:
51-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
5254
- uses: actions/setup-python@v4
5355
with:
5456
python-version: "3.9"
@@ -62,9 +64,25 @@ jobs:
6264
file: "pyproject.toml"
6365
field: "tool.typeshed.pyright_version"
6466
- name: Run pyright on typeshed
65-
uses: jakebailey/pyright-action@v1
67+
uses: jakebailey/pyright-action@v2
6668
with:
6769
version: ${{ steps.pyright_version.outputs.value }}
6870
python-platform: ${{ matrix.python-platform }}
6971
python-version: "3.9"
7072
project: ./pyrightconfig.scripts_and_tests.json
73+
stubsabot-dry-run:
74+
name: Stubsabot dry run
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: actions/setup-python@v4
79+
with:
80+
python-version: "3.11"
81+
cache: pip
82+
cache-dependency-path: requirements-tests.txt
83+
- name: Git config
84+
run: |
85+
git config --global user.name stubsabot
86+
git config --global user.email '<>'
87+
- run: pip install -r requirements-tests.txt
88+
- run: python scripts/stubsabot.py --action-level local

.github/workflows/mypy_primer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
shard-index: [0, 1, 2, 3]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
with:
3030
path: typeshed_to_test
3131
fetch-depth: 0

.github/workflows/stubsabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
if: github.repository == 'python/typeshed'
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
with:
2424
# use an ssh key so that checks automatically run on stubsabot PRs
2525
ssh-key: ${{ secrets.STUBSABOT_SSH_PRIVATE_KEY }}

.github/workflows/stubtest_stdlib.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,19 @@ jobs:
3232
matrix:
3333
# tkinter doesn't import on macOS 12
3434
os: ["ubuntu-latest", "windows-latest", "macos-11"]
35-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
35+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
3636
fail-fast: false
3737

3838
steps:
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4040
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
41-
if: ${{ matrix.os != 'macos-11' || matrix.python-version != '3.7' }}
4241
uses: actions/setup-python@v4
4342
with:
4443
python-version: ${{ matrix.python-version }}
4544
cache: pip
4645
cache-dependency-path: requirements-tests.txt
4746
allow-prereleases: true
48-
# Handle the py37 run on macos differently,
49-
# to workaround https://github.com/actions/setup-python/issues/682
50-
- name: Setup Python 3.7.16 on macos
51-
if: ${{ matrix.os == 'macos-11' && matrix.python-version == '3.7' }}
52-
uses: actions/setup-python@v4
53-
with:
54-
python-version: "3.7.16"
55-
cache: pip
56-
cache-dependency-path: requirements-tests.txt
47+
check-latest: true
5748
- name: Install dependencies
5849
run: pip install -r requirements-tests.txt
5950
- name: Run stubtest

.github/workflows/stubtest_third_party.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fail-fast: false
3737

3838
steps:
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4040
with:
4141
fetch-depth: 0
4242
- uses: actions/setup-python@v4

0 commit comments

Comments
 (0)