Skip to content

Commit

Permalink
Add the --non-interactive flag when installing type stubs via mypy
Browse files Browse the repository at this point in the history
The --non-interactive flag forces mypy to hide the errors about missing stubs and instead simply install stubs without asking for confirmation.  It also does not return an error code, which it does without this flag even if you opt to let it install the missing type stubs.

Also, move mypy command toward the end of the script, which allows all the other good things to happen even if the mypy
command fails.

Co-authored-by: Jeremy Frasier <jeremy.frasier@gwe.cisa.dhs.gov>
Co-authored-by: Mark Feldhousen <mark.feldhousen@gwe.cisa.dhs.gov>
  • Loading branch information
3 people committed Oct 18, 2024
1 parent 8642e0e commit 5db2542
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup-env
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,6 @@ for req_file in "requirements-dev.txt" "requirements-test.txt" "requirements.txt
fi
done

# Install all necessary mypy type stubs
mypy --install-types src/

# Install git pre-commit hooks now or later.
pre-commit install ${INSTALL_HOOKS:+"--install-hooks"}

Expand Down Expand Up @@ -285,5 +282,8 @@ else:
END_OF_LINE
)"

# Install all necessary mypy type stubs
mypy --install-types --non-interactive src/

# Qapla'
echo "Success!"

0 comments on commit 5db2542

Please sign in to comment.