Skip to content

Commit 52cfe84

Browse files
authored
Merge branch 'main' into deprecate_enable_shared_cache_sqlite3
2 parents 6808f60 + 85a787b commit 52cfe84

File tree

452 files changed

+5967
-4775
lines changed

Some content is hidden

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

452 files changed

+5967
-4775
lines changed

.github/workflows/daily.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
PYTHON_EXECUTABLE="python"
9797
fi
9898
99-
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
99+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
100100
101101
stub-uploader:
102102
name: stub_uploader tests

.github/workflows/meta_tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
- uses: actions/setup-python@v5
4040
with:
4141
python-version: "3.13"
42-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
42+
- uses: astral-sh/setup-uv@v6
43+
with:
44+
version-file: "requirements-tests.txt"
4345
- run: uv pip install -r requirements-tests.txt --system
4446
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }}
4547
pyright:
@@ -54,7 +56,9 @@ jobs:
5456
- uses: actions/setup-python@v5
5557
with:
5658
python-version: "3.13"
57-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
59+
- uses: astral-sh/setup-uv@v6
60+
with:
61+
version-file: "requirements-tests.txt"
5862
- run: uv pip install -r requirements-tests.txt --system
5963
- name: Run pyright on typeshed
6064
uses: jakebailey/pyright-action@v2
@@ -71,7 +75,9 @@ jobs:
7175
- uses: actions/setup-python@v5
7276
with:
7377
python-version: "3.13"
74-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
78+
- uses: astral-sh/setup-uv@v6
79+
with:
80+
version-file: "requirements-tests.txt"
7581
- name: Git config
7682
run: |
7783
git config --global user.name stubsabot

.github/workflows/stubsabot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ jobs:
2727
- uses: actions/setup-python@v5
2828
with:
2929
python-version: "3.13"
30-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
30+
- uses: astral-sh/setup-uv@v6
31+
with:
32+
version-file: "requirements-tests.txt"
3133
- name: git config
3234
run: |
3335
git config --global user.name stubsabot

.github/workflows/stubtest_third_party.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
PYTHON_EXECUTABLE="python"
8686
fi
8787
88-
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-platforms-only $STUBS
88+
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --ci-platforms-only $STUBS
8989
else
9090
echo "Nothing to test"
9191
fi

.github/workflows/tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
- uses: actions/setup-python@v5
3131
with:
3232
python-version: "3.13"
33-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
33+
- uses: astral-sh/setup-uv@v6
34+
with:
35+
version-file: "requirements-tests.txt"
3436
- run: uv pip install -r requirements-tests.txt --system
3537
- run: python ./tests/check_typeshed_structure.py
3638

@@ -48,7 +50,9 @@ jobs:
4850
- uses: actions/setup-python@v5
4951
with:
5052
python-version: ${{ matrix.python-version }}
51-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
53+
- uses: astral-sh/setup-uv@v6
54+
with:
55+
version-file: "requirements-tests.txt"
5256
- run: uv pip install -r requirements-tests.txt --system
5357
- name: Install required APT packages
5458
run: |
@@ -81,7 +85,9 @@ jobs:
8185
# Use py311 for now, as py312 seems to be around 30s slower in CI
8286
# TODO: figure out why that is (#11590)
8387
python-version: "3.11"
84-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
88+
- uses: astral-sh/setup-uv@v6
89+
with:
90+
version-file: "requirements-tests.txt"
8591
- run: uv pip install -r requirements-tests.txt --system
8692
- run: python ./tests/regr_test.py --all --verbosity QUIET
8793

CONTRIBUTING.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,22 @@ This has the following keys:
213213
that need to be installed for stubtest to run successfully
214214
* `choco_dependencies` (default: `[]`): A list of Windows Chocolatey packages
215215
that need to be installed for stubtest to run successfully
216-
* `platforms` (default: `["linux"]`): A list of OSes on which to run stubtest.
217-
Can contain `win32`, `linux`, and `darwin` values.
218-
If not specified, stubtest is run only on `linux`.
219-
Only add extra OSes to the test
220-
if there are platform-specific branches in a stubs package.
216+
* `supported_platforms` (default: all platforms): A list of OSes on which
217+
stubtest can be run. When a package is not platform-specific, this should
218+
not be set. If the package is platform-specific, this should usually be set
219+
to the supported platforms, unless stubtest is known to fail on a
220+
specific platform.
221+
* `ci_platforms` (default: `["linux"]`): A list of OSes on which to run
222+
stubtest as part of our continuous integration (CI) tests. Can contain
223+
`win32`, `linux`, and `darwin` values. If not specified, stubtest is run
224+
only on `linux`. Only add extra OSes to the test if there are
225+
platform-specific branches in a stubs package.
221226
* `mypy_plugins` (default: `[]`): A list of Python modules to use as mypy plugins
222227
when running stubtest. For example: `mypy_plugins = ["mypy_django_plugin.main"]`
223228
* `mypy_plugins_config` (default: `{}`): A dictionary mapping plugin names to their
224229
configuration dictionaries for use by mypy plugins. For example:
225230
`mypy_plugins_config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}}`
226231

227-
228232
`*_dependencies` are usually packages needed to `pip install` the implementation
229233
distribution.
230234

lib/ts_utils/metadata.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"read_stubtest_settings",
4141
]
4242

43+
DEFAULT_STUBTEST_PLATFORMS = ["linux"]
4344

4445
_STUBTEST_PLATFORM_MAPPING: Final = {"linux": "apt_dependencies", "darwin": "brew_dependencies", "win32": "choco_dependencies"}
4546
# Some older websites have a bad pattern of using query params for navigation.
@@ -81,7 +82,8 @@ class StubtestSettings:
8182
choco_dependencies: list[str]
8283
extras: list[str]
8384
ignore_missing_stub: bool
84-
platforms: list[str]
85+
supported_platforms: list[str] | None # None means all platforms
86+
ci_platforms: list[str]
8587
stubtest_requirements: list[str]
8688
mypy_plugins: list[str]
8789
mypy_plugins_config: dict[str, dict[str, Any]]
@@ -105,7 +107,8 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
105107
choco_dependencies: object = data.get("choco_dependencies", [])
106108
extras: object = data.get("extras", [])
107109
ignore_missing_stub: object = data.get("ignore_missing_stub", False)
108-
specified_platforms: object = data.get("platforms", ["linux"])
110+
supported_platforms: object = data.get("supported_platforms")
111+
ci_platforms: object = data.get("ci_platforms", DEFAULT_STUBTEST_PLATFORMS)
109112
stubtest_requirements: object = data.get("stubtest_requirements", [])
110113
mypy_plugins: object = data.get("mypy_plugins", [])
111114
mypy_plugins_config: object = data.get("mypy_plugins_config", {})
@@ -114,7 +117,8 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
114117
assert type(ignore_missing_stub) is bool
115118

116119
# It doesn't work for type-narrowing if we use a for loop here...
117-
assert _is_list_of_strings(specified_platforms)
120+
assert supported_platforms is None or _is_list_of_strings(supported_platforms)
121+
assert _is_list_of_strings(ci_platforms)
118122
assert _is_list_of_strings(apt_dependencies)
119123
assert _is_list_of_strings(brew_dependencies)
120124
assert _is_list_of_strings(choco_dependencies)
@@ -123,11 +127,16 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
123127
assert _is_list_of_strings(mypy_plugins)
124128
assert _is_nested_dict(mypy_plugins_config)
125129

126-
unrecognised_platforms = set(specified_platforms) - _STUBTEST_PLATFORM_MAPPING.keys()
127-
assert not unrecognised_platforms, f"Unrecognised platforms specified for {distribution!r}: {unrecognised_platforms}"
130+
unrecognised_platforms = set(ci_platforms) - _STUBTEST_PLATFORM_MAPPING.keys()
131+
assert not unrecognised_platforms, f"Unrecognised ci_platforms specified for {distribution!r}: {unrecognised_platforms}"
132+
133+
if supported_platforms is not None:
134+
assert set(ci_platforms).issubset(
135+
supported_platforms
136+
), f"ci_platforms must be a subset of supported_platforms for {distribution!r}"
128137

129138
for platform, dep_key in _STUBTEST_PLATFORM_MAPPING.items():
130-
if platform not in specified_platforms:
139+
if platform not in ci_platforms:
131140
assert dep_key not in data, (
132141
f"Stubtest is not run on {platform} in CI for {distribution!r}, "
133142
f"but {dep_key!r} are specified in METADATA.toml"
@@ -140,7 +149,8 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
140149
choco_dependencies=choco_dependencies,
141150
extras=extras,
142151
ignore_missing_stub=ignore_missing_stub,
143-
platforms=specified_platforms,
152+
supported_platforms=supported_platforms,
153+
ci_platforms=ci_platforms,
144154
stubtest_requirements=stubtest_requirements,
145155
mypy_plugins=mypy_plugins,
146156
mypy_plugins_config=mypy_plugins_config,
@@ -204,7 +214,8 @@ def is_obsolete(self) -> bool:
204214
"choco_dependencies",
205215
"extras",
206216
"ignore_missing_stub",
207-
"platforms",
217+
"supported_platforms",
218+
"ci_platforms",
208219
"stubtest_requirements",
209220
"mypy_plugins",
210221
"mypy_plugins_config",

lib/ts_utils/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def print_info(message: str) -> None:
5050
print(colored(message, "blue"))
5151

5252

53+
def print_warning(message: str) -> None:
54+
print(colored(message, "yellow"))
55+
56+
5357
def print_error(error: str, end: str = "\n", fix_path: tuple[str, str] = ("", "")) -> None:
5458
error_split = error.split("\n")
5559
old, new = fix_path

pyrightconfig.stricter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"stubs/auth0-python",
2828
"stubs/Authlib",
2929
"stubs/aws-xray-sdk",
30-
"stubs/beautifulsoup4",
3130
"stubs/boltons",
3231
"stubs/braintree",
3332
"stubs/cffi",

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ termcolor>=2.3
2222
tomli==2.2.1; python_version < "3.11"
2323
tomlkit==0.13.3
2424
typing_extensions>=4.14.0rc1
25-
uv==0.7.19
25+
uv==0.8.6
2626

2727
# Utilities for typeshed infrastructure scripts.
2828
ts_utils @ file:lib

0 commit comments

Comments
 (0)