Skip to content

Commit

Permalink
Merge branch 'master' into guest-mode-waits-for-init
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsheridan authored Sep 3, 2023
2 parents 1d2fc15 + d3255a0 commit cc2d74a
Show file tree
Hide file tree
Showing 153 changed files with 5,791 additions and 2,789 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ exclude_lines =
abc.abstractmethod
if TYPE_CHECKING:
if _t.TYPE_CHECKING:
if t.TYPE_CHECKING:
@overload
class .*\bProtocol\b.*\):

partial_branches =
pragma: no branch
if not TYPE_CHECKING:
if not _t.TYPE_CHECKING:
if not t.TYPE_CHECKING:
if .* or not TYPE_CHECKING:
if .* or not _t.TYPE_CHECKING:
if .* or not t.TYPE_CHECKING:
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8-nightly', 'pypy-3.9-nightly']
# pypy-3.10 is failing, see https://github.com/python-trio/trio/issues/2678
python: ['3.8', '3.9', '3.10', 'pypy-3.9-nightly'] #, 'pypy-3.10-nightly']
arch: ['x86', 'x64']
lsp: ['']
lsp_extract_file: ['']
extra_name: ['']
exclude:
- python: 'pypy-3.8-nightly'
arch: 'x86'
# 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 @@ -65,8 +67,8 @@ jobs:
# and then finally an actual release version. actions/setup-python doesn't
# support this for PyPy presently so we get no help there.
#
# CPython -> 3.9.0-alpha - 3.9.X
# PyPy -> pypy-3.7
# 'CPython' -> '3.9.0-alpha - 3.9.X'
# 'PyPy' -> 'pypy-3.9'
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
architecture: '${{ matrix.arch }}'
cache: pip
Expand All @@ -92,7 +94,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['pypy-3.7', 'pypy-3.8', 'pypy-3.9', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev', 'pypy-3.8-nightly', 'pypy-3.9-nightly']
python: ['pypy-3.9', 'pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12-dev', 'pypy-3.9-nightly', 'pypy-3.10-nightly']
check_formatting: ['0']
extra_name: ['']
include:
Expand Down Expand Up @@ -143,7 +145,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8-nightly', 'pypy-3.9-nightly']
python: ['3.8', '3.9', '3.10', 'pypy-3.9-nightly', 'pypy-3.10-nightly']
continue-on-error: >-
${{
(
Expand Down
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-case-conflict
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- "flake8-pyproject==1.2.3"
types: [file]
types_or: [python, pyi]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell

ci:
autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit.com hooks"
autofix_prs: true
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: [black,isort]
submodules: false
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include LICENSE LICENSE.MIT LICENSE.APACHE2
include README.rst
include CODE_OF_CONDUCT.md CONTRIBUTING.md
include test-requirements.txt
include trio/py.typed
recursive-include trio/_tests/test_ssl_certs *.pem
recursive-include docs *
prune docs/build
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ demonstration of implementing the "Happy Eyeballs" algorithm in an
older library versus Trio.

**Cool, but will it work on my system?** Probably! As long as you have
some kind of Python 3.7-or-better (CPython or the latest PyPy3 are
both fine), and are using Linux, macOS, Windows, or FreeBSD, then Trio
some kind of Python 3.8-or-better (CPython or [currently maintained versions of
PyPy3](https://doc.pypy.org/en/latest/faq.html#which-python-versions-does-pypy-implement)
are both fine), and are using Linux, macOS, Windows, or FreeBSD, then Trio
will work. Other environments might work too, but those
are the ones we test on. And all of our dependencies are pure Python,
except for CFFI on Windows, which has wheels available, so
Expand Down
12 changes: 7 additions & 5 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ fi
flake8 trio/ || EXIT_STATUS=$?

# Run mypy on all supported platforms
mypy -m trio -m trio.testing --platform linux || EXIT_STATUS=$?
mypy -m trio -m trio.testing --platform darwin || EXIT_STATUS=$? # tests FreeBSD too
mypy -m trio -m trio.testing --platform win32 || EXIT_STATUS=$?
mypy trio --platform linux || EXIT_STATUS=$?
mypy trio --platform darwin || EXIT_STATUS=$? # tests FreeBSD too
mypy trio --platform win32 || EXIT_STATUS=$?

# Check pip compile is consistent
pip-compile test-requirements.in
Expand All @@ -41,10 +41,12 @@ if git status --porcelain | grep -q "requirements.txt"; then
EXIT_STATUS=1
fi

codespell || EXIT_STATUS=$?

python trio/_tests/check_type_completeness.py --overwrite-file || EXIT_STATUS=$?
if git status --porcelain trio/_tests/verify_types.json | grep -q "M"; then
if git status --porcelain trio/_tests/verify_types*.json | grep -q "M"; then
echo "Type completeness changed, please update!"
git --no-pager diff --color trio/_tests/verify_types.json
git --no-pager diff --color trio/_tests/verify_types*.json
EXIT_STATUS=1
fi

Expand Down
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ else
# support subprocess spawning with coverage.py
echo "import coverage; coverage.process_startup()" | tee -a "$INSTALLDIR/../sitecustomize.py"

if COVERAGE_PROCESS_START=$(pwd)/../.coveragerc coverage run --rcfile=../.coveragerc -m pytest -r a -p trio._tests.pytest_plugin --junitxml=../test-results.xml --run-slow ${INSTALLDIR} --verbose; then
if COVERAGE_PROCESS_START=$(pwd)/../.coveragerc coverage run --rcfile=../.coveragerc -m pytest -r a -p trio._tests.pytest_plugin --junitxml=../test-results.xml --run-slow ${INSTALLDIR} --verbose --durations=10; then
PASSED=true
else
PASSED=false
Expand Down
11 changes: 6 additions & 5 deletions docs-requirements.in
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# RTD is currently installing 1.5.3, which has a bug in :lineno-match:
# sphinx-3.4 causes warnings about some trio._abc classes: GH#2338
sphinx >= 1.7.0, < 6.2
# jinja2-3.1 causes importerror with sphinx<4.0
jinja2 < 3.1
sphinx >= 4.0, < 6.2
jinja2
sphinx_rtd_theme
sphinxcontrib-jquery
sphinxcontrib-trio
towncrier

# Trio's own dependencies
cffi; os_name == "nt"
attrs >= 19.2.0
sortedcontainers
async_generator >= 1.9
idna
outcome
sniffio
exceptiongroup >= 1.0.0rc9

# See note in test-requirements.in
immutables >= 0.6

# types used in annotations
pyOpenSSL
40 changes: 24 additions & 16 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,47 @@
#
alabaster==0.7.13
# via sphinx
async-generator==1.10
# via -r docs-requirements.in
attrs==23.1.0
# via
# -r docs-requirements.in
# outcome
babel==2.12.1
# via sphinx
certifi==2023.5.7
certifi==2023.7.22
# via requests
charset-normalizer==3.1.0
cffi==1.15.1
# via cryptography
charset-normalizer==3.2.0
# via requests
click==8.1.3
click==8.1.7
# via
# click-default-group
# towncrier
click-default-group==1.2.2
click-default-group==1.2.4
# via towncrier
cryptography==41.0.3
# via pyopenssl
docutils==0.18.1
# via
# sphinx
# sphinx-rtd-theme
exceptiongroup==1.1.1
exceptiongroup==1.1.3
# via -r docs-requirements.in
idna==3.4
# via
# -r docs-requirements.in
# requests
imagesize==1.4.1
# via sphinx
immutables==0.19
immutables==0.20
# via -r docs-requirements.in
importlib-metadata==6.7.0
importlib-metadata==6.8.0
# via sphinx
importlib-resources==5.12.0
importlib-resources==6.0.1
# via towncrier
incremental==22.10.0
# via towncrier
jinja2==3.0.3
jinja2==3.1.2
# via
# -r docs-requirements.in
# sphinx
Expand All @@ -55,8 +57,12 @@ outcome==1.2.0
# via -r docs-requirements.in
packaging==23.1
# via sphinx
pygments==2.15.1
pycparser==2.21
# via cffi
pygments==2.16.1
# via sphinx
pyopenssl==23.2.0
# via -r docs-requirements.in
pytz==2023.3
# via babel
requests==2.31.0
Expand All @@ -73,7 +79,7 @@ sphinx==6.1.3
# sphinx-rtd-theme
# sphinxcontrib-jquery
# sphinxcontrib-trio
sphinx-rtd-theme==1.2.2
sphinx-rtd-theme==1.3.0
# via -r docs-requirements.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
Expand All @@ -82,7 +88,9 @@ sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
# via
# -r docs-requirements.in
# sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
Expand All @@ -95,9 +103,9 @@ tomli==2.0.1
# via towncrier
towncrier==23.6.0
# via -r docs-requirements.in
urllib3==2.0.3
urllib3==2.0.4
# via requests
zipp==3.15.0
zipp==3.16.2
# via
# importlib-metadata
# importlib-resources
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 5 additions & 0 deletions docs/source/_static/hackrtd.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ pre {
background-color: #ffe13b;
}

/* Make typevar/paramspec names distinguishable from classes. */
.typevarref {
text-decoration: dashed underline;
}

/* Add a snakey triskelion ornament to <hr>
* https://stackoverflow.com/questions/8862344/css-hr-with-ornament/18541258#18541258
* but only do it to <hr>s in the content box, b/c the RTD popup control panel
Expand Down
Loading

0 comments on commit cc2d74a

Please sign in to comment.