Skip to content

Commit 914b9e8

Browse files
authored
Merge branch 'python-trio:main' into dtls-2024
2 parents 7f70723 + af010af commit 914b9e8

File tree

97 files changed

+751
-310
lines changed

Some content is hidden

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

97 files changed

+751
-310
lines changed

.github/workflows/autodeps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
- name: Setup python
2525
uses: actions/setup-python@v5
2626
with:
27-
python-version: "3.8"
27+
python-version: "3.9"
2828

2929
- name: Bump dependencies
3030
run: |
3131
python -m pip install -U pip pre-commit
3232
python -m pip install -r test-requirements.txt
33-
uv pip compile --universal --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
33+
uv pip compile --universal --python-version=3.9 --upgrade test-requirements.in -o test-requirements.txt
3434
uv pip compile --universal --python-version=3.11 --upgrade docs-requirements.in -o docs-requirements.txt
3535
pre-commit autoupdate --jobs 0
3636
@@ -43,7 +43,7 @@ jobs:
4343

4444
- name: uv
4545
run: |
46-
uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
46+
uv pip compile --universal --python-version=3.9 test-requirements.in -o test-requirements.txt
4747
uv pip compile --universal --python-version=3.11 docs-requirements.in -o docs-requirements.txt
4848
4949
- name: Commit changes and create automerge PR

.github/workflows/ci.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12']
21+
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13']
2222
arch: ['x86', 'x64']
2323
lsp: ['']
2424
lsp_extract_file: ['']
2525
extra_name: ['']
2626
include:
27-
- python: '3.8'
27+
- python: '3.9'
2828
arch: 'x64'
2929
lsp: 'https://raw.githubusercontent.com/python-trio/trio-ci-assets/master/komodia-based-vpn-setup.zip'
3030
lsp_extract_file: 'komodia-based-vpn-setup.exe'
3131
extra_name: ', with Komodia LSP'
32-
- python: '3.8'
32+
- python: '3.9'
3333
arch: 'x64'
3434
lsp: 'https://www.proxifier.com/download/legacy/ProxifierSetup342.exe'
3535
lsp_extract_file: ''
3636
extra_name: ', with IFS LSP'
37-
#- python: '3.8'
37+
#- python: '3.9'
3838
# arch: 'x64'
3939
# lsp: 'http://download.pctools.com/mirror/updates/9.0.0.2308-SDavfree-lite_en.exe'
4040
# lsp_extract_file: ''
@@ -87,16 +87,16 @@ jobs:
8787
strategy:
8888
fail-fast: false
8989
matrix:
90-
python: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
90+
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13']
9191
check_formatting: ['0']
9292
no_test_requirements: ['0']
9393
extra_name: ['']
9494
include:
95-
- python: '3.12'
95+
- python: '3.13'
9696
check_formatting: '1'
9797
extra_name: ', check formatting'
9898
# separate test run that doesn't install test-requirements.txt
99-
- python: '3.8'
99+
- python: '3.9'
100100
no_test_requirements: '1'
101101
extra_name: ', no test-requirements'
102102
continue-on-error: >-
@@ -143,7 +143,7 @@ jobs:
143143
strategy:
144144
fail-fast: false
145145
matrix:
146-
python: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12']
146+
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13']
147147
continue-on-error: >-
148148
${{
149149
(
@@ -203,7 +203,15 @@ jobs:
203203
strategy:
204204
fail-fast: false
205205
matrix:
206-
python: ['3.8', '3.12']
206+
include:
207+
- python: '3.9' # We support running on cython 2 and 3 for 3.9
208+
cython: '<3' # cython 2
209+
- python: '3.9'
210+
cython: '>=3' # cython 3 (or greater)
211+
- python: '3.11' # 3.11 is the last version Cy2 supports
212+
cython: '<3' # cython 2
213+
- python: '3.13' # We support running cython3 on 3.13
214+
cython: '>=3' # cython 3 (or greater)
207215
steps:
208216
- name: Checkout
209217
uses: actions/checkout@v4
@@ -216,18 +224,11 @@ jobs:
216224
- name: install trio and setuptools
217225
run: python -m pip install --upgrade pip . setuptools
218226

219-
- name: install cython<3
220-
run: python -m pip install "cython<3"
221-
- name: compile pyx file
222-
run: cythonize -i tests/cython/test_cython.pyx
223-
- name: import & run module
224-
run: python -c 'import tests.cython.test_cython'
227+
- name: install cython & compile pyx file
228+
run: |
229+
python -m pip install "cython${{ matrix.cython }}"
230+
cythonize --inplace tests/cython/test_cython.pyx
225231
226-
- name: install cython>=3
227-
run: python -m pip install "cython>=3"
228-
- name: compile pyx file
229-
# different cython version should trigger a re-compile, but --force just in case
230-
run: cythonize --inplace --force tests/cython/test_cython.pyx
231232
- name: import & run module
232233
run: python -c 'import tests.cython.test_cython'
233234

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.8"
15+
python-version: "3.9"
1616
- run: python -m pip install build
1717
- run: python -m build
1818

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ci:
88

99
repos:
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.6.0
11+
rev: v5.0.0
1212
hooks:
1313
- id: trailing-whitespace
1414
- id: end-of-file-fixer
@@ -20,11 +20,11 @@ repos:
2020
- id: sort-simple-yaml
2121
files: .pre-commit-config.yaml
2222
- repo: https://github.com/psf/black-pre-commit-mirror
23-
rev: 24.8.0
23+
rev: 24.10.0
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.6.7
27+
rev: v0.6.9
2828
hooks:
2929
- id: ruff
3030
types: [file]

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ demonstration of implementing the "Happy Eyeballs" algorithm in an
9292
older library versus Trio.
9393

9494
**Cool, but will it work on my system?** Probably! As long as you have
95-
some kind of Python 3.8-or-better (CPython or `currently maintained versions of
95+
some kind of Python 3.9-or-better (CPython or `currently maintained versions of
9696
PyPy3 <https://doc.pypy.org/en/latest/faq.html#which-python-versions-does-pypy-implement>`__
9797
are both fine), and are using Linux, macOS, Windows, or FreeBSD, then Trio
9898
will work. Other environments might work too, but those

check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fi
7878

7979
# Check pip compile is consistent
8080
echo "::group::Pip Compile - Tests"
81-
uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
81+
uv pip compile --universal --python-version=3.9 test-requirements.in -o test-requirements.txt
8282
echo "::endgroup::"
8383
echo "::group::Pip Compile - Docs"
8484
uv pip compile --universal --python-version=3.11 docs-requirements.in -o docs-requirements.txt

docs-requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
sphinx >= 6.0
44
jinja2
55
# >= is necessary to prevent `uv` from selecting a `Sphinx` version this does not support
6-
sphinx_rtd_theme >= 2
6+
sphinx_rtd_theme >= 3
77
sphinxcontrib-jquery
88
sphinxcontrib-trio
99
towncrier

docs-requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ beautifulsoup4==4.12.3
1212
# via sphinx-codeautolink
1313
certifi==2024.8.30
1414
# via requests
15-
cffi==1.17.0 ; platform_python_implementation != 'PyPy' or os_name == 'nt'
15+
cffi==1.17.1 ; platform_python_implementation != 'PyPy' or os_name == 'nt'
1616
# via
1717
# -r docs-requirements.in
1818
# cryptography
@@ -24,15 +24,15 @@ colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows'
2424
# via
2525
# click
2626
# sphinx
27-
cryptography==43.0.0
27+
cryptography==43.0.1
2828
# via pyopenssl
2929
docutils==0.20.1
3030
# via
3131
# sphinx
3232
# sphinx-rtd-theme
3333
exceptiongroup==1.2.2
3434
# via -r docs-requirements.in
35-
idna==3.8
35+
idna==3.10
3636
# via
3737
# -r docs-requirements.in
3838
# requests
@@ -77,9 +77,9 @@ sphinx==7.4.7
7777
# sphinxcontrib-trio
7878
sphinx-codeautolink==0.15.2
7979
# via -r docs-requirements.in
80-
sphinx-hoverxref==1.4.0
80+
sphinx-hoverxref==1.4.1
8181
# via -r docs-requirements.in
82-
sphinx-rtd-theme==2.0.0
82+
sphinx-rtd-theme==3.0.0
8383
# via -r docs-requirements.in
8484
sphinxcontrib-applehelp==2.0.0
8585
# via sphinx
@@ -102,5 +102,5 @@ sphinxcontrib-trio==1.1.2
102102
# via -r docs-requirements.in
103103
towncrier==24.8.0
104104
# via -r docs-requirements.in
105-
urllib3==2.2.2
105+
urllib3==2.2.3
106106
# via requests

docs/source/conf.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ def setup(app: Sphinx) -> None:
201201
app.connect("source-read", on_read_source)
202202

203203

204+
# Our docs use the READTHEDOCS variable, so copied from:
205+
# https://about.readthedocs.com/blog/2024/07/addons-by-default/
206+
if os.environ.get("READTHEDOCS", "") == "True":
207+
if "html_context" not in globals():
208+
html_context = {}
209+
html_context["READTHEDOCS"] = True
210+
204211
# -- General configuration ------------------------------------------------
205212

206213
# If your documentation needs a minimal Sphinx version, state it here.
@@ -374,10 +381,7 @@ def add_mapping(
374381
# We have to set this ourselves, not only because it's useful for local
375382
# testing, but also because if we don't then RTD will throw away our
376383
# html_theme_options.
377-
import sphinx_rtd_theme
378-
379384
html_theme = "sphinx_rtd_theme"
380-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
381385

382386
# Theme options are theme-specific and customize the look and feel of a theme
383387
# further. For a list of options available for each theme, see the

docs/source/history.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ Release history
55

66
.. towncrier release notes start
77
8+
Trio 0.27.0 (2024-10-17)
9+
------------------------
10+
11+
Breaking changes
12+
~~~~~~~~~~~~~~~~
13+
14+
- :func:`trio.move_on_after` and :func:`trio.fail_after` previously set the deadline relative to initialization time, instead of more intuitively upon entering the context manager. This might change timeouts if a program relied on this behavior. If you want to restore previous behavior you should instead use ``trio.move_on_at(trio.current_time() + ...)``.
15+
flake8-async has a new rule to catch this, in case you're supporting older trio versions. See :ref:`ASYNC122`. (`#2512 <https://github.com/python-trio/trio/issues/2512>`__)
16+
17+
18+
Features
19+
~~~~~~~~
20+
21+
- :meth:`CancelScope.relative_deadline` and :meth:`CancelScope.is_relative` added, as well as a ``relative_deadline`` parameter to ``__init__``. This allows initializing scopes ahead of time, but where the specified relative deadline doesn't count down until the scope is entered. (`#2512 <https://github.com/python-trio/trio/issues/2512>`__)
22+
- :class:`trio.Lock` and :class:`trio.StrictFIFOLock` will now raise :exc:`trio.BrokenResourceError` when :meth:`trio.Lock.acquire` would previously stall due to the owner of the lock exiting without releasing the lock. (`#3035 <https://github.com/python-trio/trio/issues/3035>`__)
23+
- `trio.move_on_at`, `trio.move_on_after`, `trio.fail_at` and `trio.fail_after` now accept *shield* as a keyword argument. If specified, it provides an initial value for the `~trio.CancelScope.shield` attribute of the `trio.CancelScope` object created by the context manager. (`#3052 <https://github.com/python-trio/trio/issues/3052>`__)
24+
- Added :func:`trio.lowlevel.add_parking_lot_breaker` and :func:`trio.lowlevel.remove_parking_lot_breaker` to allow creating custom lock/semaphore implementations that will break their underlying parking lot if a task exits unexpectedly. :meth:`trio.lowlevel.ParkingLot.break_lot` is also added, to allow breaking a parking lot intentionally. (`#3081 <https://github.com/python-trio/trio/issues/3081>`__)
25+
26+
27+
Bugfixes
28+
~~~~~~~~
29+
30+
- Allow sockets to bind any ``os.PathLike`` object. (`#3041 <https://github.com/python-trio/trio/issues/3041>`__)
31+
- Update ``trio.lowlevel.open_process``'s documentation to allow bytes. (`#3076 <https://github.com/python-trio/trio/issues/3076>`__)
32+
- Update :func:`trio.sleep_forever` to be `NoReturn`. (`#3095 <https://github.com/python-trio/trio/issues/3095>`__)
33+
34+
35+
Improved documentation
36+
~~~~~~~~~~~~~~~~~~~~~~
37+
38+
- Add docstrings for memory channels' ``statistics()`` and ``aclose`` methods. (`#3101 <https://github.com/python-trio/trio/issues/3101>`__)
39+
40+
841
Trio 0.26.2 (2024-08-08)
942
------------------------
1043

0 commit comments

Comments
 (0)