-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into spdx-compliant-license
- Loading branch information
Showing
6 changed files
with
152 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
Windows: | ||
name: 'Windows (${{ matrix.python }})' | ||
runs-on: 'windows-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.7', '3.8', '3.9', '3.10'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
cache-dependency-path: test-requirements.txt | ||
- name: Run tests | ||
run: ./ci.sh | ||
shell: bash | ||
env: | ||
# Should match 'name:' up above | ||
JOB_NAME: 'Windows (${{ matrix.python }})' | ||
|
||
Ubuntu: | ||
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' | ||
timeout-minutes: 10 | ||
runs-on: 'ubuntu-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev'] | ||
check_formatting: ['0'] | ||
extra_name: [''] | ||
include: | ||
- python: '3.10' | ||
check_formatting: '1' | ||
extra_name: ', check formatting' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
if: "!endsWith(matrix.python, '-dev')" | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: pip | ||
cache-dependency-path: test-requirements.txt | ||
- name: Setup python (dev) | ||
uses: deadsnakes/[email protected] | ||
if: endsWith(matrix.python, '-dev') | ||
with: | ||
python-version: '${{ matrix.python }}' | ||
- name: Run tests | ||
run: ./ci.sh | ||
env: | ||
CHECK_FORMATTING: '${{ matrix.check_formatting }}' | ||
# Should match 'name:' up above | ||
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' | ||
|
||
macOS: | ||
name: 'macOS (${{ matrix.python }})' | ||
timeout-minutes: 10 | ||
runs-on: 'macos-latest' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
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 }})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
MYPY_VERSION=0.782 | ||
YAPF_VERSION=0.22.0 | ||
|
||
|
||
pip install -U pip setuptools wheel | ||
|
||
if [ "$CHECK_FORMATTING" = "1" ]; then | ||
pip install yapf==${YAPF_VERSION} | ||
if ! yapf -rpd setup.py sniffio; then | ||
cat <<EOF | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
Formatting problems were found (listed above). To fix them, run | ||
pip install yapf==${YAPF_VERSION} | ||
yapf -rpi setup.py sniffio | ||
in your local checkout. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
EOF | ||
exit 1 | ||
fi | ||
pip install mypy==${MYPY_VERSION} | ||
if ! mypy --pretty sniffio; then | ||
cat <<EOF | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
Type checking problems were found (listed above). | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
EOF | ||
exit 1 | ||
fi | ||
exit 0 | ||
fi | ||
|
||
python setup.py sdist --formats=zip | ||
pip install dist/*.zip | ||
|
||
# Actual tests | ||
pip install -Ur test-requirements.txt | ||
|
||
mkdir empty | ||
cd empty | ||
|
||
pytest -W error -ra -v --pyargs sniffio --cov=sniffio --cov-config=../.coveragerc --verbose | ||
|
||
bash <(curl -s https://codecov.io/bash) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters