Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI scripts to match httpcore (#1043)
* Update CI scripts to match httpcore * Run test suite on pushes to master * Update scripts README * Don't bother with flake8 extensions for now * Remove unnecessary PYTHONPATH from build, publish * test_routing: Use a stub app instead of ellipsis * Add link to issue about type-checking tests
- Loading branch information
Showing
27 changed files
with
161 additions
and
51 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
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
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
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,13 @@ | ||
#!/bin/sh -e | ||
|
||
if [ -d 'venv' ] ; then | ||
PREFIX="venv/bin/" | ||
else | ||
PREFIX="" | ||
fi | ||
|
||
set -x | ||
|
||
${PREFIX}python setup.py sdist bdist_wheel | ||
${PREFIX}twine check dist/* | ||
${PREFIX}mkdocs build |
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,14 @@ | ||
#!/bin/sh -e | ||
|
||
export PREFIX="" | ||
if [ -d 'venv' ] ; then | ||
export PREFIX="venv/bin/" | ||
fi | ||
export SOURCE_FILES="starlette tests" | ||
|
||
set -x | ||
|
||
${PREFIX}isort --check --diff --project=starlette $SOURCE_FILES | ||
${PREFIX}black --check --diff $SOURCE_FILES | ||
${PREFIX}flake8 $SOURCE_FILES | ||
${PREFIX}mypy $SOURCE_FILES |
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,10 @@ | ||
#!/bin/sh -e | ||
|
||
export PREFIX="" | ||
if [ -d 'venv' ] ; then | ||
export PREFIX="venv/bin/" | ||
fi | ||
|
||
set -x | ||
|
||
${PREFIX}coverage report --show-missing --skip-covered --fail-under=100 |
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,10 @@ | ||
#!/bin/sh -e | ||
|
||
export PREFIX="" | ||
if [ -d 'venv' ] ; then | ||
export PREFIX="venv/bin/" | ||
fi | ||
|
||
set -x | ||
|
||
${PREFIX}mkdocs serve |
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
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 |
---|---|---|
@@ -1,17 +1,18 @@ | ||
#!/bin/sh -e | ||
#!/bin/sh | ||
|
||
export PREFIX="" | ||
if [ -d 'venv' ] ; then | ||
export PREFIX="venv/bin/" | ||
fi | ||
|
||
export VERSION_SCRIPT="import sys; print('%s.%s' % sys.version_info[0:2])" | ||
export PYTHON_VERSION=`python -c "$VERSION_SCRIPT"` | ||
set -ex | ||
|
||
set -x | ||
if [ -z $GITHUB_ACTIONS ]; then | ||
scripts/check | ||
fi | ||
|
||
${PREFIX}pytest $@ | ||
|
||
PYTHONPATH=. ${PREFIX}pytest --ignore venv --cov-config tests/.ignore_lifespan -W ignore::DeprecationWarning --cov=starlette --cov=tests --cov-fail-under=100 --cov-report=term-missing ${@} | ||
${PREFIX}mypy starlette --ignore-missing-imports --disallow-untyped-defs | ||
${PREFIX}autoflake --recursive starlette tests setup.py | ||
${PREFIX}isort --profile=black --combine-as --check starlette tests setup.py | ||
${PREFIX}black starlette tests setup.py --check | ||
if [ -z $GITHUB_ACTIONS ]; then | ||
scripts/coverage | ||
fi |
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,19 @@ | ||
[flake8] | ||
ignore = W503, E203, B305 | ||
max-line-length = 88 | ||
|
||
[mypy] | ||
disallow_untyped_defs = True | ||
ignore_missing_imports = True | ||
|
||
[mypy-tests.*] | ||
disallow_untyped_defs = False | ||
# https://github.com/encode/starlette/issues/1045 | ||
# check_untyped_defs = True | ||
|
||
[tool:isort] | ||
profile = black | ||
combine_as_imports = True | ||
|
||
[tool:pytest] | ||
addopts = --cov-report= --cov=starlette --cov=tests -rxXs |
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
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 |
---|---|---|
|
@@ -275,4 +275,4 @@ async def handle_graphiql(self, request: Request) -> Response: | |
</script> | ||
</body> | ||
</html> | ||
""" | ||
""" # noqa: E501 |
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
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
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
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
Oops, something went wrong.