diff --git a/redwood/redwood/__init__.pyi b/redwood/redwood/__init__.pyi index d25a7679e2..8ff56d7eee 100644 --- a/redwood/redwood/__init__.pyi +++ b/redwood/redwood/__init__.pyi @@ -2,7 +2,7 @@ # see https://pyo3.rs/v0.16.4/python_typing_hints.html from pathlib import Path -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_file(recipients: list[str], plaintext: Path, destination: Path) -> None: ... def decrypt(ciphertext: bytes, secret_key: str, passphrase: str) -> str: ... 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