Skip to content

Commit f43c212

Browse files
committed
Merge branch 'main' of https://github.com/python/typeshed into networkx-merge-from-python-type-stubs
2 parents 2ba94b7 + c901b9b commit f43c212

File tree

393 files changed

+6021
-4545
lines changed

Some content is hidden

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

393 files changed

+6021
-4545
lines changed

.github/workflows/daily.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,19 @@ jobs:
8080
8181
if [ "${{ runner.os }}" = "Linux" ]; then
8282
if [ -n "$PACKAGES" ]; then
83+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8384
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
8485
fi
8586
8687
PYTHON_EXECUTABLE="xvfb-run python"
8788
else
8889
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
90+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8991
brew install -q $PACKAGES
9092
fi
9193
9294
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
95+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
9396
choco install -y $PACKAGES
9497
fi
9598

.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ jobs:
6666
6767
if [ "${{ runner.os }}" = "Linux" ]; then
6868
if [ -n "$PACKAGES" ]; then
69-
echo "Installing apt packages: $PACKAGES"
69+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
7070
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
7171
fi
7272
7373
PYTHON_EXECUTABLE="xvfb-run python"
7474
else
7575
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
76-
echo "Installing Homebrew packages: $PACKAGES"
76+
printf "Installing Homebrew packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
7777
brew install -q $PACKAGES
7878
fi
7979
8080
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
81-
echo "Installing Chocolatey packages: $PACKAGES"
81+
printf "Installing Chocolatey packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
8282
choco install -y $PACKAGES
8383
fi
8484

.github/workflows/tests.yml

Lines changed: 22 additions & 18 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,15 +50,16 @@ 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: |
55-
sudo apt-get update -qy
56-
DEPENDENCIES=$( python tests/get_external_apt_dependencies.py )
57-
if [ -n "$DEPENDENCIES" ]; then
58-
printf "Installing APT packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
59-
sudo apt-get install -qy $DEPENDENCIES
59+
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
60+
if [ -n "$PACKAGES" ]; then
61+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
62+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
6063
fi
6164
- name: Run mypy_test.py
6265
run: |
@@ -81,7 +84,9 @@ jobs:
8184
# Use py311 for now, as py312 seems to be around 30s slower in CI
8285
# TODO: figure out why that is (#11590)
8386
python-version: "3.11"
84-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
87+
- uses: astral-sh/setup-uv@v6
88+
with:
89+
version-file: "requirements-tests.txt"
8590
- run: uv pip install -r requirements-tests.txt --system
8691
- run: python ./tests/regr_test.py --all --verbosity QUIET
8792

@@ -102,24 +107,23 @@ jobs:
102107
with:
103108
version-file: "requirements-tests.txt"
104109
- name: Install typeshed test-suite requirements
105-
# Install these so we can run `get_external_stub_requirements.py`
110+
# Install these so we can run `get_*_requirements.py`
106111
run: uv pip install -r requirements-tests.txt --system
107112
- name: Install required APT packages
108113
run: |
109-
sudo apt-get update -qy
110-
DEPENDENCIES=$( python tests/get_external_apt_dependencies.py )
111-
if [ -n "$DEPENDENCIES" ]; then
112-
printf "Installing APT packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
113-
sudo apt-get install -qy $DEPENDENCIES
114+
PACKAGES=$(python tests/get_stubtest_system_requirements.py)
115+
if [ -n "$PACKAGES" ]; then
116+
printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
117+
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
114118
fi
115119
- name: Create an isolated venv for testing
116120
run: uv venv .venv
117121
- name: Install 3rd-party stub dependencies
118122
run: |
119-
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
120-
if [ -n "$DEPENDENCIES" ]; then
121-
printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
122-
uv pip install --python-version ${{ matrix.python-version }} $DEPENDENCIES
123+
PACKAGES=$(python tests/get_external_stub_requirements.py)
124+
if [ -n "$PACKAGES" ]; then
125+
printf "Installing python packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
126+
uv pip install --python-version ${{ matrix.python-version }} $PACKAGES
123127
fi
124128
- name: Activate the isolated venv for the rest of the job
125129
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH

lib/ts_utils/requirements.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ def get_external_stub_requirements(distributions: Iterable[str] = ()) -> set[Req
1818
return set(itertools.chain.from_iterable([read_dependencies(distribution).external_pkgs for distribution in distributions]))
1919

2020

21-
def get_stubtest_system_requirements(distributions: Iterable[str] = (), platform: str = sys.platform) -> list[str]:
21+
def get_stubtest_system_requirements(distributions: Iterable[str] = (), platform: str = sys.platform) -> set[str]:
2222
if not distributions:
2323
distributions = os.listdir(STUBS_PATH)
2424

25-
requirements: list[str] = []
26-
for distribution in distributions:
27-
requirements.extend(read_stubtest_settings(distribution).system_requirements_for_platform(platform))
28-
return requirements
25+
return set(
26+
itertools.chain.from_iterable(
27+
[read_stubtest_settings(distribution).system_requirements_for_platform(platform) for distribution in distributions]
28+
)
29+
)

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ stubdefaulter==0.1.0; python_version < "3.14"
2121
termcolor>=2.3
2222
tomli==2.2.1; python_version < "3.11"
2323
tomlkit==0.13.3
24-
typing_extensions>=4.14.0rc1
25-
uv==0.7.19
24+
typing_extensions>=4.15.0rc1
25+
uv==0.8.6
2626

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

0 commit comments

Comments
 (0)