diff --git a/redwood/redwood/__init__.pyi b/redwood/redwood/__init__.pyi index 90a0ede213..d4179e740a 100644 --- a/redwood/redwood/__init__.pyi +++ b/redwood/redwood/__init__.pyi @@ -3,7 +3,7 @@ from pathlib import Path from typing import BinaryIO -def generate_source_key_pair(passphrase: str, email: str) -> (str, str, str): ... +def generate_source_key_pair(passphrase: str, email: str) -> tuple[str, str, str]: ... def encrypt_message(recipients: list[str], plaintext: str, destination: Path) -> None: ... def encrypt_stream(recipients: list[str], plaintext: BinaryIO, destination: Path) -> None: ... def decrypt(ciphertext: bytes, secret_key: str, passphrase: str) -> bytes: ... diff --git a/securedrop/bin/run-mypy b/securedrop/bin/run-mypy index a88dc335a6..25f9d8840c 100755 --- a/securedrop/bin/run-mypy +++ b/securedrop/bin/run-mypy @@ -7,8 +7,9 @@ REPOROOT=$(git rev-parse --show-toplevel) cd "${REPOROOT}" if [ "$(command -v mypy)" ]; then - source "securedrop/bin/dev-deps" - build_redwood + # Point mypy at the redwood package with type stub, see second option on + # . + export MYPYPATH="./redwood" mypy ./securedrop ./admin --namespace-packages --explicit-package-bases "$@" elif [ -d "/opt/venvs/securedrop-app-code/" ]; then # Inside the dev container, but no mypy