Skip to content

Commit 611a89d

Browse files
authored
Merge branch 'main' into repl_ki
2 parents 240f9ff + 4f54774 commit 611a89d

Some content is hidden

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

77 files changed

+2410
-979
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# For files generated by trio/_tools/gen_exports.py
1+
# For files generated by trio/_tools/gen_exports.py or trio/_tools/windows_ffi_build.py
22
trio/_core/_generated* linguist-generated=true
33
# Treat generated files as binary in git diff
44
trio/_core/_generated* -diff

.github/workflows/ci.yml

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,17 @@ jobs:
176176
lsp: ''
177177
lsp_extract_file: ''
178178
extra_name: ''
179+
- python: 'pypy-3.11'
180+
arch: 'x64'
181+
lsp: ''
182+
lsp_extract_file: ''
183+
extra_name: ''
179184
#- python: '3.9'
180185
# arch: 'x64'
181186
# lsp: 'http://download.pctools.com/mirror/updates/9.0.0.2308-SDavfree-lite_en.exe'
182187
# lsp_extract_file: ''
183188
# extra_name: ', with non-IFS LSP'
189+
184190
continue-on-error: >-
185191
${{
186192
(
@@ -199,18 +205,11 @@ jobs:
199205
- name: Setup python
200206
uses: actions/setup-python@v5
201207
with:
202-
# This allows the matrix to specify just the major.minor version while still
203-
# expanding it to get the latest patch version including alpha releases.
204-
# This avoids the need to update for each new alpha, beta, release candidate,
205-
# and then finally an actual release version. actions/setup-python doesn't
206-
# support this for PyPy presently so we get no help there.
207-
#
208-
# 'CPython' -> '3.9.0-alpha - 3.9.X'
209-
# 'PyPy' -> 'pypy-3.9'
210-
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
208+
python-version: '${{ matrix.python }}'
211209
architecture: '${{ matrix.arch }}'
212210
cache: pip
213211
cache-dependency-path: test-requirements.txt
212+
allow-prereleases: true
214213
- name: Run tests
215214
run: ./ci.sh
216215
shell: bash
@@ -237,7 +236,7 @@ jobs:
237236
strategy:
238237
fail-fast: false
239238
matrix:
240-
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
239+
python: ['pypy-3.10', 'pypy-3.11', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
241240
check_formatting: ['0']
242241
no_test_requirements: ['0']
243242
extra_name: ['']
@@ -273,13 +272,23 @@ jobs:
273272
- name: Setup python
274273
uses: actions/setup-python@v5
275274
with:
276-
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
275+
python-version: '${{ matrix.python }}'
277276
cache: pip
278277
cache-dependency-path: test-requirements.txt
278+
allow-prereleases: true
279+
- name: Check Formatting
280+
if: matrix.check_formatting == '1'
281+
run:
282+
python -m pip install tox &&
283+
tox -m check
284+
- name: Install python3-apport
285+
run: |
286+
sudo apt update
287+
sudo apt install -q python3-apport
279288
- name: Run tests
289+
if: matrix.check_formatting == '0'
280290
run: ./ci.sh
281291
env:
282-
CHECK_FORMATTING: '${{ matrix.check_formatting }}'
283292
NO_TEST_REQUIREMENTS: '${{ matrix.no_test_requirements }}'
284293
- if: >-
285294
always()
@@ -301,7 +310,7 @@ jobs:
301310
strategy:
302311
fail-fast: false
303312
matrix:
304-
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
313+
python: ['pypy-3.10', 'pypy-3.11', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
305314
continue-on-error: >-
306315
${{
307316
(
@@ -320,9 +329,10 @@ jobs:
320329
- name: Setup python
321330
uses: actions/setup-python@v5
322331
with:
323-
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
332+
python-version: '${{ matrix.python }}'
324333
cache: pip
325334
cache-dependency-path: test-requirements.txt
335+
allow-prereleases: true
326336
- name: Run tests
327337
run: ./ci.sh
328338
- if: always()
@@ -348,19 +358,29 @@ jobs:
348358
# `nodejs` for pyright (`node-env` pulls in nodejs but that takes a while and can time out the test).
349359
# `perl` for a platform independent `sed -i` alternative
350360
run: apk update && apk add python3-dev bash nodejs perl
361+
351362
- name: Retrieve the project source from an sdist inside the GHA artifact
352363
# must be after `apk add` because it relies on `bash` existing
353364
uses: re-actors/checkout-python-sdist@release/v2
354365
with:
355366
source-tarball-name: ${{ needs.build.outputs.sdist-artifact-name }}
356367
workflow-artifact-name: ${{ env.dists-artifact-name }}
368+
357369
- name: Enter virtual environment
358370
run: python -m venv .venv
371+
359372
- name: Run tests
360373
run: source .venv/bin/activate && ./ci.sh
374+
361375
- name: Get Python version for codecov flag
362376
id: get-version
363-
run: echo "version=$(python -V | cut -d' ' -f2 | cut -d'.' -f1,2)" >> "${GITHUB_OUTPUT}"
377+
shell: python
378+
run: |
379+
import sys, os
380+
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
381+
f.write("version=" + ".".join(map(str, sys.version_info[:2])))
382+
f.write("\n")
383+
364384
- if: always()
365385
uses: codecov/codecov-action@v3
366386
with:
@@ -417,11 +437,19 @@ jobs:
417437
- name: import & run module
418438
run: coverage run -m tests.cython.run_test_cython
419439

420-
- name: get Python version for codecov flag
440+
- name: Get Python version for codecov flag
421441
id: get-version
422-
run: >-
423-
echo "version=$(python -V | cut -d' ' -f2 | cut -d'.' -f1,2)"
424-
>> "${GITHUB_OUTPUT}"
442+
shell: python
443+
run: |
444+
import sys, os
445+
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
446+
f.write("version=" + ".".join(map(str, sys.version_info[:2])))
447+
f.write("\n")
448+
449+
- run: |
450+
coverage combine
451+
coverage report
452+
425453
- if: always()
426454
uses: codecov/codecov-action@v5
427455
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# generated by cythonize
2+
tests/cython/test_cython.c
3+
14
# In case somebody wants to restore the directory for local testing
25
notes-to-self/
36

.pre-commit-config.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ repos:
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.9.6
27+
rev: v0.12.0
2828
hooks:
29-
- id: ruff
29+
- id: ruff-check
3030
types: [file]
3131
types_or: [python, pyi, toml]
3232
args: ["--show-fixes"]
@@ -37,16 +37,16 @@ repos:
3737
additional_dependencies:
3838
# tomli needed on 3.10. tomllib is available in stdlib on 3.11+
3939
- tomli
40-
- repo: https://github.com/crate-ci/typos
41-
rev: typos-dict-v0.12.4
40+
- repo: https://github.com/adhtruong/mirrors-typos
41+
rev: v1.33.1
4242
hooks:
4343
- id: typos
4444
- repo: https://github.com/sphinx-contrib/sphinx-lint
4545
rev: v1.0.0
4646
hooks:
4747
- id: sphinx-lint
4848
- repo: https://github.com/woodruffw/zizmor-pre-commit
49-
rev: v1.3.1
49+
rev: v1.9.0
5050
hooks:
5151
- id: zizmor
5252
- repo: local
@@ -58,8 +58,22 @@ repos:
5858
pass_filenames: false
5959
additional_dependencies: ["astor", "attrs", "black", "ruff"]
6060
files: ^src\/trio\/_core\/(_run|(_i(o_(common|epoll|kqueue|windows)|nstrumentation)))\.py$
61+
- id: regenerate-windows-cffi
62+
name: regenerate windows CFFI
63+
language: python
64+
entry: python src/trio/_tools/windows_ffi_build.py
65+
pass_filenames: false
66+
additional_dependencies: ["cffi"]
67+
files: ^src\/trio\/_tools\/windows_ffi_build\.py$
68+
- id: sync-test-requirements
69+
name: synchronize test requirements
70+
language: python
71+
entry: python src/trio/_tools/sync_requirements.py
72+
pass_filenames: false
73+
additional_dependencies: ["pyyaml"]
74+
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
6175
- repo: https://github.com/astral-sh/uv-pre-commit
62-
rev: 0.5.30
76+
rev: 0.7.13
6377
hooks:
6478
# Compile requirements
6579
- id: pip-compile

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ I/O-oriented programs easier, less error-prone, and just plain more
5656
fun. `Perhaps you'll find the same
5757
<https://github.com/python-trio/trio/wiki/Testimonials>`__.
5858

59-
This project is young and still somewhat experimental: the overall
60-
design is solid, and the existing features are fully tested and
61-
documented, but you may encounter missing functionality or rough
62-
edges. We *do* encourage you to use it, but you should `read and
63-
subscribe to issue #1
64-
<https://github.com/python-trio/trio/issues/1>`__ to get a warning and a
65-
chance to give feedback about any compatibility-breaking changes.
59+
Trio is a mature and well-tested project: the overall design is solid,
60+
and the existing features are fully documented and widely used in
61+
production. While we occasionally make minor interface adjustments,
62+
breaking changes are rare. We encourage you to use Trio with confidence,
63+
but if you rely on long-term API stability, consider `subscribing to
64+
issue #1 <https://github.com/python-trio/trio/issues/1>`__ for advance
65+
notice of any compatibility updates.
6666

6767

6868
Where to next?

check.sh

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)