From: Sebastián Ramírez Date: Sat, 8 Dec 2018 07:58:24 +0000 (+0400) Subject: :construction_worker: Add scripts, stolen from Starlette X-Git-Tag: 0.1.11~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12dbc1758381bb6d7b7a8f70b789ce6247fa4132;p=thirdparty%2Ffastapi%2Ffastapi.git :construction_worker: Add scripts, stolen from Starlette --- diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100644 index 0000000000..8f71ee4a62 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,5 @@ +#!/bin/sh -e +set -x + +black fastapi tests +isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --apply fastapi tests diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100644 index 0000000000..e2b76b2379 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e + +export VERSION_SCRIPT="import sys; print('%s.%s' % sys.version_info[0:2])" +export PYTHON_VERSION=`python -c "$VERSION_SCRIPT"` + +set -x + +PYTHONPATH=. pytest --cov=fastapi --cov=tests --cov-fail-under=100 --cov-report=term-missing ${@} --cov-report=html +mypy fastapi --disallow-untyped-defs +if [ "${PYTHON_VERSION}" = '3.7' ]; then + echo "Skipping 'black' on 3.7. See issue https://github.com/ambv/black/issues/494" +else + black fastapi tests --check +fi +isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --check-only fastapi tests