Prefix titles with Python version during multiruns
pawamoy opened this issue · 0 comments
pawamoy commented
# duties.py
MULTIRUN = os.environ.get("MULTIRUN", "0") == "1"
def pyprefix(title: str) -> str: # noqa: D103
if MULTIRUN:
prefix = f"(python{sys.version_info.major}.{sys.version_info.minor})"
return f"{prefix:14}{title}"
return title
# scripts/multirun.sh
export MULTIRUN=1
# TODO: remove echo statements
It then looks like:
% make check
> Currently selected Python version: python3.9
✓ (python3.7) Checking code quality
✓ (python3.7) Type-checking
✓ (python3.7) Building documentation
✓ (python3.8) Checking code quality
✓ (python3.8) Type-checking
✓ (python3.8) Building documentation
✓ (python3.9) Checking code quality
✓ (python3.9) Type-checking
✓ (python3.9) Building documentation
✓ (python3.10) Checking code quality
✓ (python3.10) Type-checking
✓ (python3.10) Building documentation
✓ (python3.11) Checking code quality
✓ (python3.11) Type-checking
✓ (python3.11) Building documentation
> Restored previous Python version: python3.9
✓ Exporting dependencies as requirements
✓ Checking dependencies
or
% make test
✓ (python3.7) Running tests
✓ (python3.8) Running tests
✓ (python3.9) Running tests
✓ (python3.10) Running tests
✓ (python3.11) Running tests