diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e84e47c0..2427c3997 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,12 +281,21 @@ jobs: cache: pip cache-dependency-path: test-requirements.txt allow-prereleases: true + - name: Setup minimum Python version + if: matrix.check_formatting == '1' + uses: actions/setup-python@v6 + with: + python-version: '3.10' + cache: pip + cache-dependency-path: test-requirements.txt + allow-prereleases: true - name: Check Formatting if: matrix.check_formatting == '1' run: python -m pip install tox && tox -m check - name: Install python3-apport + if: matrix.check_formatting == '0' run: | sudo apt update sudo apt install -q python3-apport diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b1369f7d..93a60033b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: # tomli needed on 3.10. tomllib is available in stdlib on 3.11+ - tomli - repo: https://github.com/adhtruong/mirrors-typos - rev: v1.40.0 + rev: v1.40.1 hooks: - id: typos - repo: https://github.com/sphinx-contrib/sphinx-lint @@ -73,7 +73,7 @@ repos: additional_dependencies: ["pyyaml"] files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$ - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.18 + rev: 0.9.21 hooks: # Compile requirements - id: pip-compile diff --git a/docs-requirements.txt b/docs-requirements.txt index b350e9be1..b14ca4a38 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -59,7 +59,9 @@ pyopenssl==25.3.0 # via -r docs-requirements.in requests==2.32.5 # via sphinx -roman-numerals-py==3.1.0 +roman-numerals==4.1.0 + # via roman-numerals-py +roman-numerals-py==4.1.0 # via sphinx sniffio==1.3.1 # via -r docs-requirements.in @@ -67,7 +69,7 @@ snowballstemmer==3.0.1 # via sphinx sortedcontainers==2.4.0 # via -r docs-requirements.in -soupsieve==2.8 +soupsieve==2.8.1 # via beautifulsoup4 sphinx==8.2.3 # via @@ -105,5 +107,5 @@ typing-extensions==4.15.0 # beautifulsoup4 # exceptiongroup # pyopenssl -urllib3==2.6.1 +urllib3==2.6.2 # via requests diff --git a/docs/source/conf.py b/docs/source/conf.py index ab0d1e505..5017f3895 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,9 @@ from pathlib import Path from typing import TYPE_CHECKING, cast -from sphinx.util.inventory import _InventoryItem +if sys.version_info >= (3, 11): + from sphinx.util.inventory import _InventoryItem + from sphinx.util.logging import getLogger if TYPE_CHECKING: @@ -280,12 +282,20 @@ def add_mapping( assert isinstance(inventory, dict) inventory = cast("Inventory", inventory) - inventory[f"py:{reftype}"][f"{target}"] = _InventoryItem( - project_name="Python", - project_version=version, - uri=f"https://docs.python.org/{url_version}/library/{library}.html/{obj}", - display_name="-", - ) + if sys.version_info >= (3, 11): + inventory[f"py:{reftype}"][f"{target}"] = _InventoryItem( + project_name="Python", + project_version=version, + uri=f"https://docs.python.org/{url_version}/library/{library}.html/{obj}", + display_name="-", + ) + else: + inventory[f"py:{reftype}"][f"{target}"] = ( + "Python", + version, + f"https://docs.python.org/{url_version}/library/{library}.html/{obj}", + "-", + ) # This has been removed in Py3.12, so add a link to the 3.11 version with deprecation warnings. add_mapping("method", "pathlib", "Path.link_to", "3.11") diff --git a/test-requirements.txt b/test-requirements.txt index 346de1f3c..d140ccb74 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -36,7 +36,7 @@ colorama==0.4.6 ; sys_platform == 'win32' # pylint # pytest # sphinx -coverage==7.13.0 +coverage==7.13.1 # via -r test-requirements.in cryptography==46.0.3 # via @@ -50,13 +50,13 @@ distlib==0.4.0 # via virtualenv docutils==0.21.2 ; python_full_version < '3.11' # via sphinx -docutils==0.22.3 ; python_full_version >= '3.11' +docutils==0.22.4 ; python_full_version >= '3.11' # via sphinx exceptiongroup==1.3.1 ; python_full_version < '3.11' # via # -r test-requirements.in # pytest -filelock==3.20.0 +filelock==3.20.1 # via virtualenv identify==2.6.15 # via pre-commit @@ -75,20 +75,20 @@ jedi==0.19.2 ; implementation_name == 'cpython' # via -r test-requirements.in jinja2==3.1.6 # via sphinx -librt==0.7.3 ; implementation_name == 'cpython' +librt==0.7.5 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy' # via mypy markupsafe==3.0.3 # via jinja2 mccabe==0.7.0 # via pylint -mypy==1.19.0 ; implementation_name == 'cpython' +mypy==1.19.1 ; implementation_name == 'cpython' # via -r test-requirements.in mypy-extensions==1.1.0 # via # -r test-requirements.in # black # mypy -nodeenv==1.9.1 +nodeenv==1.10.0 # via # pre-commit # pyright @@ -112,7 +112,7 @@ platformdirs==4.5.1 # virtualenv pluggy==1.6.0 # via pytest -pre-commit==4.5.0 +pre-commit==4.5.1 # via -r test-requirements.in pycparser==2.23 ; (implementation_name != 'PyPy' and os_name == 'nt') or (implementation_name != 'PyPy' and platform_python_implementation != 'PyPy') # via cffi @@ -134,7 +134,7 @@ pyyaml==6.0.3 # via pre-commit requests==2.32.5 # via sphinx -roman-numerals==3.1.0 ; python_full_version >= '3.11' +roman-numerals==4.1.0 ; python_full_version >= '3.11' # via sphinx ruff==0.14.10 # via -r test-requirements.in @@ -146,7 +146,9 @@ sortedcontainers==2.4.0 # via -r test-requirements.in sphinx==8.1.3 ; python_full_version < '3.11' # via -r test-requirements.in -sphinx==9.0.4 ; python_full_version >= '3.11' +sphinx==9.0.4 ; python_full_version == '3.11.*' + # via -r test-requirements.in +sphinx==9.1.0 ; python_full_version >= '3.12' # via -r test-requirements.in sphinxcontrib-applehelp==2.0.0 # via sphinx @@ -181,7 +183,7 @@ types-pyopenssl==24.1.0.20240722 # via -r test-requirements.in types-pyyaml==6.0.12.20250915 # via -r test-requirements.in -types-setuptools==80.9.0.20250822 +types-setuptools==80.9.0.20251223 # via types-cffi typing-extensions==4.15.0 # via @@ -194,9 +196,9 @@ typing-extensions==4.15.0 # pyopenssl # pyright # virtualenv -urllib3==2.6.1 +urllib3==2.6.2 # via requests -uv==0.9.18 +uv==0.9.21 # via -r test-requirements.in virtualenv==20.35.4 # via pre-commit diff --git a/tox.ini b/tox.ini index 6b1851f4d..11bd09d0c 100644 --- a/tox.ini +++ b/tox.ini @@ -97,13 +97,12 @@ base_python = 3.13 commands = pre-commit run pip-compile --all-files -# TODO: allow specifying e.g. typing-3.11 to run with --python[-]version=3.11 [testenv:typing] description = "Run type checks: mypy on all platforms, and pyright on `src/trio[/_core]/_tests/type_tests/`." deps = -r test-requirements.txt exceptiongroup -base_python = 3.13 +base_python = 3.10 set_env = PYRIGHT_PYTHON_IGNORE_WARNINGS=1 commands =