Skip to content

Commit be1c144

Browse files
committed
Merge remote-tracking branch 'origin/main' into eliminate-unbounded-queue
2 parents af71289 + 72f5931 commit be1c144

File tree

120 files changed

+3293
-1889
lines changed

Some content is hidden

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

120 files changed

+3293
-1889
lines changed

.github/workflows/autodeps.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ jobs:
1919
contents: write
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
- name: Setup python
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: "3.8"
2727
- name: Bump dependencies
2828
run: |
29-
python -m pip install -U pip
29+
python -m pip install -U pip pre-commit
3030
python -m pip install -r test-requirements.txt
31-
pip-compile -U test-requirements.in
32-
pip-compile -U docs-requirements.in
31+
uv pip compile --no-strip-markers --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
32+
uv pip compile --no-strip-markers --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
33+
pre-commit autoupdate --jobs 0
3334
- name: Black
3435
run: |
3536
# The new dependencies may contain a new black version.

.github/workflows/ci.yml

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
# pypy 3.9 and 3.10 are failing, see https://github.com/python-trio/trio/issues/2678 and https://github.com/python-trio/trio/issues/2776 respectively
22-
python: ['3.8', '3.9', '3.10'] #, 'pypy-3.9-nightly', 'pypy-3.10-nightly']
21+
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
2322
arch: ['x86', 'x64']
2423
lsp: ['']
2524
lsp_extract_file: ['']
2625
extra_name: ['']
27-
exclude:
28-
# pypy does not release 32-bit binaries
29-
- python: 'pypy-3.9-nightly'
30-
arch: 'x86'
31-
#- python: 'pypy-3.10-nightly'
32-
# arch: 'x86'
3326
include:
3427
- python: '3.8'
3528
arch: 'x64'
@@ -57,9 +50,9 @@ jobs:
5750
}}
5851
steps:
5952
- name: Checkout
60-
uses: actions/checkout@v3
53+
uses: actions/checkout@v4
6154
- name: Setup python
62-
uses: actions/setup-python@v4
55+
uses: actions/setup-python@v5
6356
with:
6457
# This allows the matrix to specify just the major.minor version while still
6558
# expanding it to get the latest patch version including alpha releases.
@@ -94,7 +87,7 @@ jobs:
9487
strategy:
9588
fail-fast: false
9689
matrix:
97-
python: ['pypy-3.9', 'pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-nightly', 'pypy-3.10-nightly']
90+
python: ['pypy-3.9', 'pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
9891
check_formatting: ['0']
9992
no_test_requirements: ['0']
10093
extra_name: ['']
@@ -117,9 +110,9 @@ jobs:
117110
}}
118111
steps:
119112
- name: Checkout
120-
uses: actions/checkout@v3
113+
uses: actions/checkout@v4
121114
- name: Setup python
122-
uses: actions/setup-python@v4
115+
uses: actions/setup-python@v5
123116
if: "!endsWith(matrix.python, '-dev')"
124117
with:
125118
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
@@ -150,7 +143,7 @@ jobs:
150143
strategy:
151144
fail-fast: false
152145
matrix:
153-
python: ['3.8', '3.9', '3.10', 'pypy-3.9-nightly', 'pypy-3.10-nightly']
146+
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
154147
continue-on-error: >-
155148
${{
156149
(
@@ -162,9 +155,9 @@ jobs:
162155
}}
163156
steps:
164157
- name: Checkout
165-
uses: actions/checkout@v3
158+
uses: actions/checkout@v4
166159
- name: Setup python
167-
uses: actions/setup-python@v4
160+
uses: actions/setup-python@v5
168161
with:
169162
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
170163
cache: pip
@@ -179,6 +172,65 @@ jobs:
179172
name: macOS (${{ matrix.python }})
180173
flags: macOS,${{ matrix.python }}
181174

175+
# run CI on a musl linux
176+
Alpine:
177+
name: "Alpine"
178+
runs-on: ubuntu-latest
179+
container: alpine
180+
steps:
181+
- name: Checkout
182+
uses: actions/checkout@v4
183+
- name: Install necessary packages
184+
# can't use setup-python because that python doesn't seem to work;
185+
# `python3-dev` (rather than `python:alpine`) for some ctypes reason,
186+
# `nodejs` for pyright (`node-env` pulls in nodejs but that takes a while and can time out the test).
187+
run: apk update && apk add python3-dev bash nodejs
188+
- name: Enter virtual environment
189+
run: python -m venv .venv
190+
- name: Run tests
191+
run: source .venv/bin/activate && ./ci.sh
192+
- if: always()
193+
uses: codecov/codecov-action@v3
194+
with:
195+
directory: empty
196+
token: 87cefb17-c44b-4f2f-8b30-1fff5769ce46
197+
name: Alpine
198+
flags: Alpine,3.12
199+
200+
Cython:
201+
name: "Cython"
202+
runs-on: ubuntu-latest
203+
strategy:
204+
fail-fast: false
205+
matrix:
206+
python: ['3.8', '3.12']
207+
steps:
208+
- name: Checkout
209+
uses: actions/checkout@v4
210+
- name: Setup python
211+
uses: actions/setup-python@v5
212+
with:
213+
python-version: '${{ matrix.python }}'
214+
cache: pip
215+
# setuptools is needed to get distutils on 3.12, which cythonize requires
216+
- name: install trio and setuptools
217+
run: python -m pip install --upgrade pip . setuptools
218+
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'
225+
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
231+
- name: import & run module
232+
run: python -c 'import tests.cython.test_cython'
233+
182234
# https://github.com/marketplace/actions/alls-green#why
183235
check: # This job does nothing and is only used for the branch protection
184236

@@ -188,6 +240,8 @@ jobs:
188240
- Windows
189241
- Ubuntu
190242
- macOS
243+
- Alpine
244+
- Cython
191245

192246
runs-on: ubuntu-latest
193247

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ci:
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.5.0
10+
rev: v4.6.0
1111
hooks:
1212
- id: trailing-whitespace
1313
- id: end-of-file-fixer
@@ -19,17 +19,17 @@ repos:
1919
- id: sort-simple-yaml
2020
files: .pre-commit-config.yaml
2121
- repo: https://github.com/psf/black-pre-commit-mirror
22-
rev: 23.12.1
22+
rev: 24.4.2
2323
hooks:
2424
- id: black
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.1.14
26+
rev: v0.5.1
2727
hooks:
2828
- id: ruff
2929
types: [file]
3030
types_or: [python, pyi, toml]
3131
args: ["--show-fixes"]
3232
- repo: https://github.com/codespell-project/codespell
33-
rev: v2.2.6
33+
rev: v2.3.0
3434
hooks:
3535
- id: codespell

LONG_DESCRIPTION.rst

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

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include LICENSE LICENSE.MIT LICENSE.APACHE2
22
include README.rst
3-
include LONG_DESCRIPTION.rst
43
include CODE_OF_CONDUCT.md CONTRIBUTING.md
54
include test-requirements.txt
65
include src/trio/py.typed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
:target: https://anaconda.org/conda-forge/trio
1919
:alt: Latest conda-forge version
2020

21-
.. image:: https://codecov.io/gh/python-trio/trio/branch/master/graph/badge.svg
21+
.. image:: https://codecov.io/gh/python-trio/trio/branch/main/graph/badge.svg
2222
:target: https://codecov.io/gh/python-trio/trio
2323
:alt: Test coverage
2424

@@ -31,7 +31,7 @@ Trio – a friendly Python library for async concurrency and I/O
3131

3232
The Trio project aims to produce a production-quality,
3333
`permissively licensed
34-
<https://github.com/python-trio/trio/blob/master/LICENSE>`__,
34+
<https://github.com/python-trio/trio/blob/main/LICENSE>`__,
3535
async/await-native I/O library for Python. Like all async libraries,
3636
its main purpose is to help you write programs that do **multiple
3737
things at the same time** with **parallelized I/O**. A web spider that
@@ -134,7 +134,7 @@ choices
134134
**I want to make sure my company's lawyers won't get angry at me!** No
135135
worries, Trio is permissively licensed under your choice of MIT or
136136
Apache 2. See `LICENSE
137-
<https://github.com/python-trio/trio/blob/master/LICENSE>`__ for details.
137+
<https://github.com/python-trio/trio/blob/main/LICENSE>`__ for details.
138138

139139

140140
Code of conduct

check.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ fi
7878

7979
# Check pip compile is consistent
8080
echo "::group::Pip Compile - Tests"
81-
pip-compile test-requirements.in
81+
uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
8282
echo "::endgroup::"
8383
echo "::group::Pip Compile - Docs"
84-
pip-compile docs-requirements.in
84+
uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
8585
echo "::endgroup::"
8686

8787
if git status --porcelain | grep -q "requirements.txt"; then
@@ -96,18 +96,8 @@ fi
9696

9797
codespell || EXIT_STATUS=$?
9898

99-
PYRIGHT=0
10099
echo "::group::Pyright interface tests"
101-
pyright --verifytypes --ignoreexternal --pythonplatform=Linux --verifytypes=trio \
102-
|| { echo "* Pyright --verifytypes (Linux) found errors." >> "$GITHUB_STEP_SUMMARY"; PYRIGHT=1; }
103-
pyright --verifytypes --ignoreexternal --pythonplatform=Darwin --verifytypes=trio \
104-
|| { echo "* Pyright --verifytypes (Mac) found errors." >> "$GITHUB_STEP_SUMMARY"; PYRIGHT=1; }
105-
pyright --verifytypes --ignoreexternal --pythonplatform=Windows --verifytypes=trio \
106-
|| { echo "* Pyright --verifytypes (Windows) found errors." >> "$GITHUB_STEP_SUMMARY"; PYRIGHT=1; }
107-
if [ $PYRIGHT -ne 0 ]; then
108-
echo "::error:: Pyright --verifytypes returned errors."
109-
EXIT_STATUS=1
110-
fi
100+
python src/trio/_tests/check_type_completeness.py || EXIT_STATUS=$?
111101

112102
pyright src/trio/_tests/type_tests || EXIT_STATUS=$?
113103
pyright src/trio/_core/_tests/type_tests || EXIT_STATUS=$?

docs-requirements.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ sphinx_rtd_theme
66
sphinxcontrib-jquery
77
sphinxcontrib-trio
88
towncrier
9+
sphinx-hoverxref
10+
sphinx-codeautolink
911

1012
# Trio's own dependencies
1113
cffi; os_name == "nt"
12-
attrs >= 19.2.0
14+
attrs >= 23.2.0
1315
sortedcontainers
1416
idna
1517
outcome

0 commit comments

Comments
 (0)