Skip to content

Commit 68c1077

Browse files
authored
Merge branch 'main' into croniter-6.0.0
2 parents 2128897 + be52954 commit 68c1077

File tree

242 files changed

+16103
-10315
lines changed

Some content is hidden

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

242 files changed

+16103
-10315
lines changed

.flake8

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
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
43
# F821: Typeshed is a testing ground for flake8-pyi, which monkeypatches F821
5-
select = NQA, Y, F821
4+
select = Y, F821
65
# Ignore rules normally excluded by default
76
extend-ignore = Y090
87
per-file-ignores =
9-
# We should only need to noqa Y and F821 codes in .pyi files
10-
*.py: NQA
118
# Generated protobuf files:
129
# Y021: Include docstrings
1310
# Y023: Alias typing as typing_extensions
@@ -16,4 +13,3 @@ per-file-ignores =
1613
stubs/*_pb2.pyi: Y021, Y023, Y026, Y053
1714

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

.github/workflows/daily.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ 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"]
37+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
4038
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
4139
fail-fast: false
4240

@@ -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,7 +114,8 @@ jobs:
120114
path: stub_uploader
121115
- uses: actions/setup-python@v5
122116
with:
123-
python-version: "3.12"
117+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
118+
python-version: "3.13"
124119
- uses: astral-sh/setup-uv@v5
125120
- name: Run tests
126121
run: |
@@ -130,7 +125,7 @@ jobs:
130125
131126
# https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2
132127
create-issue-on-failure:
133-
name: Create an issue if daily tests failed
128+
name: Create issue on failure
134129
runs-on: ubuntu-latest
135130
needs: [stubtest-stdlib, stubtest-third-party, stub-uploader]
136131
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,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

+2-2
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

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ 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"]
33+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
3634
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
3735
fail-fast: false
3836

.github/workflows/stubtest_third_party.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ 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:
3434
matrix:
35-
# As of 2024-10-18, ubuntu-latest can refer to different Ubuntu versions,
36-
# which causes problems when testing gdb.
37-
os: ["ubuntu-24.04", "windows-latest", "macos-latest"]
35+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
3836
fail-fast: false
3937

4038
steps:
@@ -43,9 +41,7 @@ jobs:
4341
fetch-depth: 0
4442
- uses: actions/setup-python@v5
4543
with:
46-
# TODO: Use Python 3.12. As of 2024-03-08, several third-party
47-
# packages fail to install with Python 3.12.
48-
python-version: "3.11"
44+
python-version: "3.13"
4945
cache: pip
5046
cache-dependency-path: |
5147
requirements-tests.txt
@@ -71,7 +67,7 @@ jobs:
7167
if [ "${{ runner.os }}" = "Linux" ]; then
7268
if [ -n "$PACKAGES" ]; then
7369
echo "Installing apt packages: $PACKAGES"
74-
sudo apt-get update && sudo apt-get install -y $PACKAGES
70+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
7571
fi
7672
7773
PYTHON_EXECUTABLE="xvfb-run python"

.github/workflows/tests.yml

+13-15
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`
@@ -110,9 +110,6 @@ jobs:
110110
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
111111
if [ -n "$DEPENDENCIES" ]; then
112112
printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
113-
# TODO: We need to specify the platform here, but the platforms
114-
# strings supported by uv are different from the ones supported by
115-
# pyright.
116113
uv pip install --python-version ${{ matrix.python-version }} $DEPENDENCIES
117114
fi
118115
- name: Activate the isolated venv for the rest of the job
@@ -125,26 +122,26 @@ jobs:
125122
version: PATH
126123
python-platform: ${{ matrix.python-platform }}
127124
python-version: ${{ matrix.python-version }}
128-
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.
129126
- name: Run pyright with stricter settings on some of the stubs
130127
uses: jakebailey/pyright-action@v2
131128
with:
132129
version: PATH
133130
python-platform: ${{ matrix.python-platform }}
134131
python-version: ${{ matrix.python-version }}
135-
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.
136133
project: ./pyrightconfig.stricter.json
137134
- name: Run pyright on the test cases
138135
uses: jakebailey/pyright-action@v2
139136
with:
140137
version: PATH
141138
python-platform: ${{ matrix.python-platform }}
142139
python-version: ${{ matrix.python-version }}
143-
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.
144141
project: ./pyrightconfig.testcases.json
145142

146143
stub-uploader:
147-
name: Run the stub_uploader tests
144+
name: stub_uploader tests
148145
runs-on: ubuntu-latest
149146
steps:
150147
- name: Checkout typeshed
@@ -158,7 +155,8 @@ jobs:
158155
path: stub_uploader
159156
- uses: actions/setup-python@v5
160157
with:
161-
python-version: "3.12"
158+
# Keep in sync with stub_uploader's check_scripts.yml workflow.
159+
python-version: "3.13"
162160
- uses: astral-sh/setup-uv@v5
163161
- name: Run tests
164162
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ repos:
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/pycqa/flake8
34-
rev: 7.1.1
34+
rev: 7.1.2
3535
hooks:
3636
- id: flake8
3737
language: python
3838
additional_dependencies:
39-
- "flake8-noqa==1.4.0"
4039
- "flake8-pyi==24.9.0"
4140
types: [file]
4241
types_or: [python, pyi]

0 commit comments

Comments
 (0)