Skip to content

Commit 5548344

Browse files
Merge branch 'main' into list_signatures
2 parents f372300 + 098f30e commit 5548344

247 files changed

Lines changed: 4631 additions & 1505 deletions

File tree

Some content is hidden

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

.github/workflows/daily.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
matrix:
3737
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
38+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
3939
exclude:
4040
# https://github.com/python/typeshed/issues/15694
4141
- os: "windows-latest"

.github/workflows/mypy_primer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
shard-index: [0, 1, 2, 3]
25+
shard-index: [0, 1, 2, 3, 4, 5]
2626
fail-fast: false
2727
steps:
2828
- uses: actions/checkout@v6
@@ -52,7 +52,7 @@ jobs:
5252
--new v${MYPY_VERSION} --old v${MYPY_VERSION} \
5353
--custom-typeshed-repo typeshed_to_test \
5454
--new-typeshed $GITHUB_SHA --old-typeshed upstream_main \
55-
--num-shards 4 --shard-index ${{ matrix.shard-index }} \
55+
--num-shards 6 --shard-index ${{ matrix.shard-index }} \
5656
--debug \
5757
--output concise \
5858
| tee diff_${{ matrix.shard-index }}.txt

.github/workflows/stubtest_stdlib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
matrix:
3333
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
34-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
3535
exclude:
3636
# https://github.com/python/typeshed/issues/15694
3737
- os: "windows-latest"

.github/workflows/tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
platform: ["linux", "win32", "darwin"]
45-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
45+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
4646
fail-fast: false
4747
steps:
4848
- uses: actions/checkout@v6
@@ -83,6 +83,8 @@ jobs:
8383
runs-on: ubuntu-latest
8484
strategy:
8585
matrix:
86+
# TODO: Add 3.15 once pyright CI can avoid installing third-party
87+
# runtime dependency stacks that do not support Python 3.15 yet.
8688
python-platform: ["Linux", "Windows", "Darwin"]
8789
python-version: ["3.11", "3.12", "3.13", "3.14"]
8890
fail-fast: false

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
- id: flake8
3737
language: python
3838
additional_dependencies:
39-
- "flake8-pyi==25.5.0"
39+
- "flake8-pyi==26.5.0"
4040
types: [file]
4141
types_or: [python, pyi]
4242
- repo: meta

CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,6 @@ Features from the `typing` module that are not present in all
366366
supported Python versions must be imported from `typing_extensions`
367367
instead in typeshed stubs. This currently affects:
368368

369-
- `TypeAlias` (new in Python 3.10)
370-
- `Concatenate` (new in Python 3.10)
371-
- `ParamSpec` (new in Python 3.10)
372-
- `TypeGuard` (new in Python 3.10)
373369
- `Self` (new in Python 3.11)
374370
- `Never` (new in Python 3.11)
375371
- `LiteralString` (new in Python 3.11)

lib/ts_utils/py315.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Helpers for Python 3.15 test infrastructure."""
2+
3+
# These stubs require runtime dependencies that do not install cleanly on Python 3.15 yet.
4+
PY315_INCOMPATIBLE_RUNTIME_DEPENDENCIES = {
5+
# Depend on numpy, which does not provide Python 3.15 wheels yet.
6+
"JACK-Client",
7+
"geopandas",
8+
"hnswlib",
9+
"networkx",
10+
"pycocotools",
11+
"resampy",
12+
"shapely",
13+
"tensorflow",
14+
# Depends on referencing, which depends on rpds-py. rpds-py currently uses
15+
# PyO3, which rejects Python 3.15.
16+
"jsonschema",
17+
# Depends on matplotlib, which depends on contourpy. contourpy does not
18+
# provide Python 3.15 wheels yet.
19+
"seaborn",
20+
}

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ extend-safe-fixes = [
147147
"UP036", # Remove unnecessary `sys.version_info` blocks
148148
]
149149
ignore = [
150-
###
151-
# TODO: Disabled temporarily, until Python 3.9 support is fully removed in
152-
# May 2026.
153-
###
154-
"UP035", # import from typing
155-
"UP036", # Remove unnecessary `sys.version_info` blocks
156150
###
157151
# Rules that can conflict with the formatter (Black)
158152
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
@@ -238,6 +232,7 @@ ignore = [
238232
"D", # pydocstyle
239233
# See comment on black's force-exclude config above
240234
"E501", # Line too long
235+
"UP036", # Remove unnecessary `sys.version_info` blocks
241236
]
242237

243238
[tool.ruff.lint.pydocstyle]

requirements-tests.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# Type checkers that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible.
3-
mypy==1.20.0
4-
pyright==1.1.408
3+
mypy==2.1.0
4+
pyright==1.1.409
55

66
# Libraries used by our various scripts.
77
aiohttp==3.13.5
8-
grpcio-tools>=1.76.0 # For grpc_tools.protoc
9-
mypy-protobuf==5.0.0
8+
grpcio-tools>=1.76.0; python_version < "3.15" # For grpc_tools.protoc
9+
mypy-protobuf==5.0.0; python_version < "3.15"
1010
packaging==26.0
1111
pathspec>=1.1.1
1212
pre-commit
13-
# Required by create_baseline_stubs.py. Must match .pre-commit-config.yaml.
13+
# Required by create_baseline_stubs.py.
14+
# stubdefaulter depends on libcst, which does not yet install cleanly on Python 3.15.
1415
ruff==0.15.8
15-
stubdefaulter==0.1.0
16+
stubdefaulter==0.1.0; python_version < "3.15"
1617
termcolor>=2.3
1718
tomli==2.4.1; python_version < "3.11"
1819
tomlkit==0.14.0

scripts/sync_protobuf/_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44
import sys
55
from collections.abc import Iterable
66
from http.client import HTTPResponse
7+
from importlib.metadata import PackageNotFoundError, version
78
from pathlib import Path
89
from typing import TYPE_CHECKING
910
from urllib.request import urlopen
1011
from zipfile import ZipFile
1112

12-
from mypy_protobuf.main import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
13-
__version__ as mypy_protobuf__version__,
14-
)
13+
try:
14+
_mypy_protobuf_version = version("mypy-protobuf")
15+
except PackageNotFoundError:
16+
_mypy_protobuf_version = "unavailable"
1517

1618
if TYPE_CHECKING:
1719
from _typeshed import StrOrBytesPath, StrPath
1820

19-
MYPY_PROTOBUF_VERSION = mypy_protobuf__version__
21+
MYPY_PROTOBUF_VERSION = _mypy_protobuf_version
2022

2123

2224
def download_file(url: str, destination: Path) -> None:

0 commit comments

Comments
 (0)