Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ 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
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
Expand Down Expand Up @@ -105,5 +107,5 @@ typing-extensions==4.15.0
# beautifulsoup4
# exceptiongroup
# pyopenssl
urllib3==2.6.1
urllib3==2.6.2
# via requests
24 changes: 17 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")
Expand Down
26 changes: 14 additions & 12 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakkdl or @webknjaz: I don't think I understood what this is about. (I don't really know much about tox :/)

I assume this change doesn't fix it, but I can't really visualize what fixing this looks like.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this about what we pass to mypy? Or to pip install? Because we configure mypy in https://github.com/python-trio/trio/blob/main/pyproject.toml#L191 (oops, just realized we use 3.10 not 3.11).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably about passing different python version and platform args to MyPy, IIRC.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, well that doesn't seem excessively helpful (it rhymes with a goal I've had of having mypy check all python versions, but I think there are more effective ways than copying and pasting a given tox config section... and anyways the TODO probably isn't that helpful in getting this.)

[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 =
Expand Down