Skip to content

Commit

Permalink
Merge branch 'master' into lsp_assets
Browse files Browse the repository at this point in the history
  • Loading branch information
A5rocks authored Aug 1, 2023
2 parents 6c28923 + ccf4e24 commit 75fe4fd
Show file tree
Hide file tree
Showing 174 changed files with 5,103 additions and 2,143 deletions.
14 changes: 10 additions & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[run]
branch=True
source=trio
# For some reason coverage recording doesn't work for ipython_custom_exc.py,
# so leave it out of reports
omit=
setup.py
*/ipython_custom_exc.py
# Omit the generated files in trio/_core starting with _public_
# These are run in subprocesses, but still don't work. We follow
# coverage's documentation to no avail.
*/trio/_core/_tests/test_multierror_scripts/*
# Omit the generated files in trio/_core starting with _generated_
*/trio/_core/_generated_*
# Script used to check type completeness that isn't run in tests
*/trio/_tests/check_type_completeness.py
# The test suite spawns subprocesses to test some stuff, so make sure
# this doesn't corrupt the coverage files
parallel=True
Expand All @@ -19,10 +21,14 @@ exclude_lines =
abc.abstractmethod
if TYPE_CHECKING:
if _t.TYPE_CHECKING:
if t.TYPE_CHECKING:
@overload

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:
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# sorting all imports with isort
933f77b96f0092e1baab4474a9208fc2e379aa32
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
trio/_core/_generated* linguist-generated=true
# Treat generated files as binary in git diff
trio/_core/_generated* -diff
# don't merge the generated json file, let the user (script) handle it
trio/_tests/verify_types.json merge=binary
36 changes: 0 additions & 36 deletions .github/dependabot.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/autodeps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Autodeps

on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'

jobs:
Autodeps:
name: Autodeps
timeout-minutes: 10
runs-on: 'ubuntu-latest'
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#changing-github_token-permissions
permissions:
pull-requests: write
issues: write
repository-projects: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Bump dependencies
run: |
python -m pip install -U pip
python -m pip install -r test-requirements.txt
pip-compile -U test-requirements.in
pip-compile -U docs-requirements.in
- name: Black
run: |
# The new dependencies may contain a new black version.
# Commit any changes immediately.
python -m pip install -r test-requirements.txt
black setup.py trio
- name: Commit changes and create automerge PR
env:
GH_TOKEN: ${{ github.token }}
run: |
# setup git repo
git switch --force-create autodeps/bump_from_${GITHUB_SHA:0:6}
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
if ! git commit -am "Dependency updates"; then
echo "No changes to commit!"
exit 0
fi
git push --force --set-upstream origin autodeps/bump_from_${GITHUB_SHA:0:6}
# git push returns before github is ready for a pr, so we poll until success
for BACKOFF in 1 2 4 8 0; do
sleep $BACKOFF
if gh pr create \
--label dependencies --body "" \
--title "Bump dependencies from commit ${GITHUB_SHA:0:6}" \
; then
break
fi
done
if [ $BACKOFF -eq 0 ]; then
echo "Could not create the PR"
exit 1
fi
# gh pr create returns before the pr is ready, so we again poll until success
# https://github.com/cli/cli/issues/2619#issuecomment-1240543096
for BACKOFF in 1 2 4 8 0; do
sleep $BACKOFF
if gh pr merge --auto --squash; then
break
fi
done
if [ $BACKOFF -eq 0 ]; then
echo "Could not set automerge"
exit 1
fi
101 changes: 63 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- "dependabot/**"
pull_request:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && format('-{0}', github.sha) || '' }}
cancel-in-progress: true

jobs:
Windows:
name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})'
Expand All @@ -14,11 +18,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
# 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:
# 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 All @@ -35,25 +46,29 @@ jobs:
# lsp: 'http://download.pctools.com/mirror/updates/9.0.0.2308-SDavfree-lite_en.exe'
# lsp_extract_file: ''
# extra_name: ', with non-IFS LSP'
- python: '3.8' # <- not actually used
arch: 'x64'
pypy_nightly_branch: 'py3.8'
extra_name: ', pypy 3.8 nightly'

continue-on-error: >-
${{
(
endsWith(matrix.python, '-dev')
|| endsWith(matrix.python, '-nightly')
)
&& true
|| false
}}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
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.
# This avoids the need to update for each new alpha, beta, release candidate,
# 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 @@ -64,8 +79,13 @@ jobs:
env:
LSP: '${{ matrix.lsp }}'
LSP_EXTRACT_FILE: '${{ matrix.lsp_extract_file }}'
# Should match 'name:' up above
JOB_NAME: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})'
- if: always()
uses: codecov/codecov-action@v3
with:
directory: empty
token: 87cefb17-c44b-4f2f-8b30-1fff5769ce46
name: Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})
flags: Windows,${{ matrix.python }}

Ubuntu:
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
Expand All @@ -74,35 +94,28 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['pypy-3.7', 'pypy-3.8', '3.7', '3.8', '3.9', '3.10', '3.11-dev']
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']
pypy_nightly_branch: ['']
extra_name: ['']
include:
- python: '3.8'
check_formatting: '1'
extra_name: ', check formatting'
- python: '3.7' # <- not actually used
pypy_nightly_branch: 'py3.7'
extra_name: ', pypy 3.7 nightly'
- python: '3.8' # <- not actually used
pypy_nightly_branch: 'py3.8'
extra_name: ', pypy 3.8 nightly'
continue-on-error: >-
${{
(
matrix.check_formatting == '1'
|| matrix.pypy_nightly_branch == 'py3.7'
|| endsWith(matrix.python, '-dev')
|| endsWith(matrix.python, '-nightly')
)
&& true
|| false
}}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
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 All @@ -116,38 +129,50 @@ jobs:
- name: Run tests
run: ./ci.sh
env:
PYPY_NIGHTLY_BRANCH: '${{ matrix.pypy_nightly_branch }}'
CHECK_FORMATTING: '${{ matrix.check_formatting }}'
# Should match 'name:' up above
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
- if: always()
uses: codecov/codecov-action@v3
with:
directory: empty
token: 87cefb17-c44b-4f2f-8b30-1fff5769ce46
name: Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})
flags: Ubuntu,${{ matrix.python }}

macOS:
name: 'macOS (${{ matrix.python }})'
timeout-minutes: 10
timeout-minutes: 15
runs-on: 'macos-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
include:
- python: '3.8' # <- not actually used
arch: 'x64'
pypy_nightly_branch: 'py3.8'
extra_name: ', pypy 3.8 nightly'
python: ['3.8', '3.9', '3.10', 'pypy-3.9-nightly', 'pypy-3.10-nightly']
continue-on-error: >-
${{
(
endsWith(matrix.python, '-dev')
|| endsWith(matrix.python, '-nightly')
)
&& true
|| false
}}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
cache: pip
cache-dependency-path: test-requirements.txt
- name: Run tests
run: ./ci.sh
env:
# Should match 'name:' up above
JOB_NAME: 'macOS (${{ matrix.python }})'
- if: always()
uses: codecov/codecov-action@v3
with:
directory: empty
token: 87cefb17-c44b-4f2f-8b30-1fff5769ce46
name: macOS (${{ matrix.python }})
flags: macOS,${{ matrix.python }}

# https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection
Expand Down
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ formats:
- htmlzip
- epub

build:
os: "ubuntu-22.04"
tools:
python: "3.11"

python:
version: 3.7
install:
- requirements: docs-requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ include LICENSE LICENSE.MIT LICENSE.APACHE2
include README.rst
include CODE_OF_CONDUCT.md CONTRIBUTING.md
include test-requirements.txt
recursive-include trio/tests/test_ssl_certs *.pem
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
Loading

0 comments on commit 75fe4fd

Please sign in to comment.