Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into eliminate-unbounded-q…
Browse files Browse the repository at this point in the history
…ueue
  • Loading branch information
CoolCat467 committed Aug 1, 2024
2 parents af71289 + 72f5931 commit be1c144
Show file tree
Hide file tree
Showing 120 changed files with 3,293 additions and 1,889 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/autodeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Bump dependencies
run: |
python -m pip install -U pip
python -m pip install -U pip pre-commit
python -m pip install -r test-requirements.txt
pip-compile -U test-requirements.in
pip-compile -U docs-requirements.in
uv pip compile --no-strip-markers --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
uv pip compile --no-strip-markers --python-version=3.8 --upgrade docs-requirements.in -o docs-requirements.txt
pre-commit autoupdate --jobs 0
- name: Black
run: |
# The new dependencies may contain a new black version.
Expand Down
86 changes: 70 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@ jobs:
strategy:
fail-fast: false
matrix:
# 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
python: ['3.8', '3.9', '3.10'] #, 'pypy-3.9-nightly', 'pypy-3.10-nightly']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
arch: ['x86', 'x64']
lsp: ['']
lsp_extract_file: ['']
extra_name: ['']
exclude:
# pypy does not release 32-bit binaries
- python: 'pypy-3.9-nightly'
arch: 'x86'
#- python: 'pypy-3.10-nightly'
# arch: 'x86'
include:
- python: '3.8'
arch: 'x64'
Expand Down Expand Up @@ -57,9 +50,9 @@ jobs:
}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# This allows the matrix to specify just the major.minor version while still
# expanding it to get the latest patch version including alpha releases.
Expand Down Expand Up @@ -94,7 +87,7 @@ jobs:
strategy:
fail-fast: false
matrix:
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']
python: ['pypy-3.9', 'pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
check_formatting: ['0']
no_test_requirements: ['0']
extra_name: ['']
Expand All @@ -117,9 +110,9 @@ jobs:
}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: "!endsWith(matrix.python, '-dev')"
with:
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
Expand Down Expand Up @@ -150,7 +143,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.8', '3.9', '3.10', 'pypy-3.9-nightly', 'pypy-3.10-nightly']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
continue-on-error: >-
${{
(
Expand All @@ -162,9 +155,9 @@ jobs:
}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
cache: pip
Expand All @@ -179,6 +172,65 @@ jobs:
name: macOS (${{ matrix.python }})
flags: macOS,${{ matrix.python }}

# run CI on a musl linux
Alpine:
name: "Alpine"
runs-on: ubuntu-latest
container: alpine
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install necessary packages
# can't use setup-python because that python doesn't seem to work;
# `python3-dev` (rather than `python:alpine`) for some ctypes reason,
# `nodejs` for pyright (`node-env` pulls in nodejs but that takes a while and can time out the test).
run: apk update && apk add python3-dev bash nodejs
- name: Enter virtual environment
run: python -m venv .venv
- name: Run tests
run: source .venv/bin/activate && ./ci.sh
- if: always()
uses: codecov/codecov-action@v3
with:
directory: empty
token: 87cefb17-c44b-4f2f-8b30-1fff5769ce46
name: Alpine
flags: Alpine,3.12

Cython:
name: "Cython"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.8', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python }}'
cache: pip
# setuptools is needed to get distutils on 3.12, which cythonize requires
- name: install trio and setuptools
run: python -m pip install --upgrade pip . setuptools

- name: install cython<3
run: python -m pip install "cython<3"
- name: compile pyx file
run: cythonize -i tests/cython/test_cython.pyx
- name: import & run module
run: python -c 'import tests.cython.test_cython'

- name: install cython>=3
run: python -m pip install "cython>=3"
- name: compile pyx file
# different cython version should trigger a re-compile, but --force just in case
run: cythonize --inplace --force tests/cython/test_cython.pyx
- name: import & run module
run: python -c 'import tests.cython.test_cython'

# https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection

Expand All @@ -188,6 +240,8 @@ jobs:
- Windows
- Ubuntu
- macOS
- Alpine
- Cython

runs-on: ubuntu-latest

Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -19,17 +19,17 @@ repos:
- id: sort-simple-yaml
files: .pre-commit-config.yaml
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.5.1
hooks:
- id: ruff
types: [file]
types_or: [python, pyi, toml]
args: ["--show-fixes"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
65 changes: 0 additions & 65 deletions LONG_DESCRIPTION.rst

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include LICENSE LICENSE.MIT LICENSE.APACHE2
include README.rst
include LONG_DESCRIPTION.rst
include CODE_OF_CONDUCT.md CONTRIBUTING.md
include test-requirements.txt
include src/trio/py.typed
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:target: https://anaconda.org/conda-forge/trio
:alt: Latest conda-forge version

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

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

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


Code of conduct
Expand Down
16 changes: 3 additions & 13 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ fi

# Check pip compile is consistent
echo "::group::Pip Compile - Tests"
pip-compile test-requirements.in
uv pip compile --no-strip-markers --python-version=3.8 test-requirements.in -o test-requirements.txt
echo "::endgroup::"
echo "::group::Pip Compile - Docs"
pip-compile docs-requirements.in
uv pip compile --no-strip-markers --python-version=3.8 docs-requirements.in -o docs-requirements.txt
echo "::endgroup::"

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

codespell || EXIT_STATUS=$?

PYRIGHT=0
echo "::group::Pyright interface tests"
pyright --verifytypes --ignoreexternal --pythonplatform=Linux --verifytypes=trio \
|| { echo "* Pyright --verifytypes (Linux) found errors." >> "$GITHUB_STEP_SUMMARY"; PYRIGHT=1; }
pyright --verifytypes --ignoreexternal --pythonplatform=Darwin --verifytypes=trio \
|| { echo "* Pyright --verifytypes (Mac) found errors." >> "$GITHUB_STEP_SUMMARY"; PYRIGHT=1; }
pyright --verifytypes --ignoreexternal --pythonplatform=Windows --verifytypes=trio \
|| { echo "* Pyright --verifytypes (Windows) found errors." >> "$GITHUB_STEP_SUMMARY"; PYRIGHT=1; }
if [ $PYRIGHT -ne 0 ]; then
echo "::error:: Pyright --verifytypes returned errors."
EXIT_STATUS=1
fi
python src/trio/_tests/check_type_completeness.py || EXIT_STATUS=$?

pyright src/trio/_tests/type_tests || EXIT_STATUS=$?
pyright src/trio/_core/_tests/type_tests || EXIT_STATUS=$?
Expand Down
4 changes: 3 additions & 1 deletion docs-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ sphinx_rtd_theme
sphinxcontrib-jquery
sphinxcontrib-trio
towncrier
sphinx-hoverxref
sphinx-codeautolink

# Trio's own dependencies
cffi; os_name == "nt"
attrs >= 19.2.0
attrs >= 23.2.0
sortedcontainers
idna
outcome
Expand Down
Loading

0 comments on commit be1c144

Please sign in to comment.