@@ -30,66 +30,42 @@ 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
34- - run : uv pip install --group=dev --system
35- - run : python ./tests/check_typeshed_structure.py
36-
37- pytype :
38- name : " pytype: Check stubs"
39- runs-on : ubuntu-latest
40- steps :
41- - uses : actions/checkout@v4
42- - uses : actions/setup-python@v5
43- with :
44- # Max supported Python version as of pytype 2024.10.11
45- python-version : " 3.12"
4633 - uses : astral-sh/setup-uv@v6
34+ with :
35+ version-file : " pyproject.toml"
4736 - run : uv pip install --group=dev --system
48- - name : Install external dependencies for 3rd-party stubs
49- run : |
50- DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
51- if [ -n "$DEPENDENCIES" ]; then
52- printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
53- uv pip install --system $DEPENDENCIES
54- fi
55- - run : uv pip freeze
56- - run : ./tests/pytype_test.py --print-stderr
37+ - run : python ./tests/check_typeshed_structure.py
5738
5839 mypy :
5940 name : " mypy: Check stubs"
6041 runs-on : ubuntu-latest
6142 strategy :
6243 matrix :
6344 platform : ["linux", "win32", "darwin"]
64- # TODO (2025-05-10) "3.13.2" should be "3.14-dev", see below.
65- python-version : ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13.2"]
45+ python-version : ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
6646 fail-fast : false
6747 steps :
6848 - uses : actions/checkout@v4
6949 - uses : actions/setup-python@v5
7050 with :
7151 python-version : ${{ matrix.python-version }}
72- - run : curl -LsSf https://astral.sh/uv/install.sh | sh
52+ allow-prereleases : true
53+ - uses : astral-sh/setup-uv@v6
54+ with :
55+ version-file : " pyproject.toml"
7356 - run : uv pip install -r requirements-tests.txt --system
7457 - name : Install required APT packages
7558 run : |
76- sudo apt-get update -qy
77- DEPENDENCIES=$( python tests/get_external_apt_dependencies.py )
78- if [ -n "$DEPENDENCIES" ]; then
79- printf "Installing APT packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
80- 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
8163 fi
8264 - name : Run mypy_test.py
8365 run : |
84- # TODO: (2025-05-10) This is a bad hack to work around mypy crashing
85- # when running on Python 3.14. See https://github.com/python/mypy/pull/19020.
86- if [[ "${{ matrix.python-version }}" == "3.13.2" ]]; then
87- MYPY_PY_VERSION="3.14"
88- else
89- # python-version can sometimes be pinned to a specific version or to "-dev", but
90- # mypy understands only X.Y version numbers.
91- MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2)
92- fi
66+ # python-version can sometimes be pinned to a specific version or to "-dev", but
67+ # mypy understands only X.Y version numbers.
68+ MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2)
9369 python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION}
9470
9571 regression-tests :
10278 # Use py311 for now, as py312 seems to be around 30s slower in CI
10379 # TODO: figure out why that is (#11590)
10480 python-version : " 3.11"
105- - run : curl -LsSf https://astral.sh/uv/install.sh | sh
81+ - uses : astral-sh/setup-uv@v6
82+ with :
83+ version-file : " pyproject.toml"
10684 - run : uv pip install --group=dev --system
10785 - run : python ./tests/regr_test.py --all --verbosity QUIET
10886
@@ -120,25 +98,26 @@ jobs:
12098 with :
12199 python-version : " 3.13"
122100 - uses : astral-sh/setup-uv@v6
101+ with :
102+ version-file : " pyproject.toml"
123103 - name : Install typeshed test-suite requirements
124- # Install these so we can run `get_external_stub_requirements .py`
104+ # Install these so we can run `get_*_requirements .py`
125105 run : uv pip install --group=dev --system
126106 - name : Install required APT packages
127107 run : |
128- sudo apt-get update -qy
129- DEPENDENCIES=$( python tests/get_external_apt_dependencies.py )
130- if [ -n "$DEPENDENCIES" ]; then
131- printf "Installing APT packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
132- sudo apt-get install -qy $DEPENDENCIES
108+ PACKAGES=$(python tests/get_stubtest_system_requirements.py)
109+ if [ -n "$PACKAGES" ]; then
110+ printf "Installing APT packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
111+ sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
133112 fi
134113 - name : Create an isolated venv for testing
135114 run : uv venv .venv
136115 - name : Install 3rd-party stub dependencies
137116 run : |
138- DEPENDENCIES =$( python tests/get_external_stub_requirements.py )
139- if [ -n "$DEPENDENCIES " ]; then
140- printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
141- uv pip install --python-version ${{ matrix.python-version }} $DEPENDENCIES
117+ PACKAGES =$(python tests/get_external_stub_requirements.py)
118+ if [ -n "$PACKAGES " ]; then
119+ printf "Installing python packages:\n $(echo $PACKAGES | sed 's/ /\n /g')\n"
120+ uv pip install --python-version ${{ matrix.python-version }} $PACKAGES
142121 fi
143122 - name : Activate the isolated venv for the rest of the job
144123 run : echo "$PWD/.venv/bin" >> $GITHUB_PATH
@@ -186,6 +165,8 @@ jobs:
186165 # Keep in sync with stub_uploader's check_scripts.yml workflow.
187166 python-version : " 3.13"
188167 - uses : astral-sh/setup-uv@v6
168+ with :
169+ version-file : " typeshed/requirements-tests.txt"
189170 - name : Run tests
190171 run : |
191172 cd stub_uploader
0 commit comments