Skip to content
Snippets Groups Projects
Commit 603ca8ac authored by Simon McVittie's avatar Simon McVittie
Browse files

Merge branch 'wip/smcv/trivia' into 'master'

Fix warnings from QA checks (mypy etc.)

See merge request steam/pressure-vessel!48
parents 0e542d7b dc3fa8a7
No related branches found
No related tags found
No related merge requests found
...@@ -28,20 +28,19 @@ set -u ...@@ -28,20 +28,19 @@ set -u
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
export MYPYPATH="${PYTHONPATH:="$(pwd)"}" export MYPYPATH="${PYTHONPATH:="$(pwd)"}"
i=0 i=0
for script in \ for script in \
"${G_TEST_SRCDIR}"/*.py \ ./*.py \
"${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ ./pressure-vessel-test-ui \
"${G_TEST_SRCDIR}"/sysroot/*.py \ ./sysroot/*.py \
"${G_TEST_SRCDIR}"/tests/*.py \ ./tests/*.py \
; do ; do
i=$((i + 1)) i=$((i + 1))
if [ "x${MYPY:="$(command -v mypy || echo false)"}" = xfalse ]; then if [ "x${MYPY:="$(command -v mypy || echo false)"}" = xfalse ]; then
......
...@@ -28,11 +28,10 @@ set -u ...@@ -28,11 +28,10 @@ set -u
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
if [ "x${PYCODESTYLE:=pycodestyle}" = xfalse ] || \ if [ "x${PYCODESTYLE:=pycodestyle}" = xfalse ] || \
[ -z "$(command -v "$PYCODESTYLE")" ]; then [ -z "$(command -v "$PYCODESTYLE")" ]; then
...@@ -48,10 +47,10 @@ echo "1..1" ...@@ -48,10 +47,10 @@ echo "1..1"
if "${PYCODESTYLE}" \ if "${PYCODESTYLE}" \
--ignore=E402,W503 \ --ignore=E402,W503 \
"$G_TEST_SRCDIR"/*.py \ ./*.py \
"${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ ./pressure-vessel-test-ui \
"${G_TEST_SRCDIR}"/sysroot/*.py \ ./sysroot/*.py \
"${G_TEST_SRCDIR}"/tests/*.py \ ./tests/*.py \
>&2; then >&2; then
echo "ok 1 - $PYCODESTYLE reported no issues" echo "ok 1 - $PYCODESTYLE reported no issues"
else else
......
...@@ -28,20 +28,19 @@ set -u ...@@ -28,20 +28,19 @@ set -u
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
if [ "x${PYFLAKES:=pyflakes3}" = xfalse ] || \ if [ "x${PYFLAKES:=pyflakes3}" = xfalse ] || \
[ -z "$(command -v "$PYFLAKES")" ]; then [ -z "$(command -v "$PYFLAKES")" ]; then
echo "1..0 # SKIP pyflakes3 not found" echo "1..0 # SKIP pyflakes3 not found"
elif "${PYFLAKES}" \ elif "${PYFLAKES}" \
"${G_TEST_SRCDIR}"/*.py \ ./*.py \
"${G_TEST_SRCDIR}"/pressure-vessel-test-ui \ ./pressure-vessel-test-ui \
"${G_TEST_SRCDIR}"/sysroot/*.py \ ./sysroot/*.py \
"${G_TEST_SRCDIR}"/tests/*.py \ ./tests/*.py \
>&2; then >&2; then
echo "1..1" echo "1..1"
echo "ok 1 - $PYFLAKES reported no issues" echo "ok 1 - $PYFLAKES reported no issues"
......
...@@ -122,8 +122,10 @@ def check_dependencies(test, relocatable_install, path, is_wrapper=False): ...@@ -122,8 +122,10 @@ def check_dependencies(test, relocatable_install, path, is_wrapper=False):
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
universal_newlines=True, universal_newlines=True,
) )
stdout = subproc.stdout
assert stdout is not None # for mypy
for line in subproc.stdout: for line in stdout:
line = line.strip() line = line.strip()
if ( if (
......
...@@ -28,19 +28,18 @@ fi ...@@ -28,19 +28,18 @@ fi
if [ -z "${G_TEST_SRCDIR-}" ]; then if [ -z "${G_TEST_SRCDIR-}" ]; then
me="$(readlink -f "$0")" me="$(readlink -f "$0")"
srcdir="${me%/*}" G_TEST_SRCDIR="${me%/*}"
G_TEST_SRCDIR="${srcdir%/*}"
fi fi
cd "$G_TEST_SRCDIR" cd "$G_TEST_SRCDIR/.."
n=0 n=0
for shell_script in \ for shell_script in \
pressure-vessel-unruntime \ ./pressure-vessel-unruntime \
pressure-vessel-unruntime-scout \ ./pressure-vessel-unruntime-scout \
pressure-vessel-unruntime-test-ui \ ./pressure-vessel-unruntime-test-ui \
pressure-vessel-locale-gen \ ./pressure-vessel-locale-gen \
tests/*.sh \ ./tests/*.sh \
; do ; do
n=$((n + 1)) n=$((n + 1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment