From 720a6a59869b55891450ffebca1b4c8d2513afba Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Sun, 12 Oct 2025 21:01:13 +0200 Subject: [PATCH] Disable syntax highlighting for platform version information. Add highlight=False to console.print() in session header to prevent version numbers from being colorized. Also update documentation markdown files to remove span tags from Platform lines for consistency. --- CHANGELOG.md | 1 + docs/source/_static/md/capture.md | 2 +- docs/source/_static/md/clean-dry-run-directories.md | 2 +- docs/source/_static/md/clean-dry-run.md | 2 +- docs/source/_static/md/collect-nodes.md | 2 +- docs/source/_static/md/collect.md | 2 +- docs/source/_static/md/defining-dependencies-products.md | 2 +- docs/source/_static/md/dry-run.md | 2 +- docs/source/_static/md/explain.md | 2 +- docs/source/_static/md/migrating-from-scripts-to-pytask.md | 2 +- docs/source/_static/md/pdb.md | 2 +- docs/source/_static/md/persist-executed.md | 2 +- docs/source/_static/md/persist-persisted.md | 2 +- docs/source/_static/md/persist-skipped.md | 2 +- docs/source/_static/md/profiling-tasks.md | 2 +- docs/source/_static/md/readme.md | 2 +- docs/source/_static/md/repeating-tasks.md | 2 +- docs/source/_static/md/show-locals.md | 2 +- docs/source/_static/md/trace.md | 2 +- docs/source/_static/md/try-first.md | 2 +- docs/source/_static/md/try-last.md | 2 +- docs/source/_static/md/warning.md | 2 +- docs/source/_static/md/write-a-task.md | 2 +- src/_pytask/logging.py | 3 ++- 24 files changed, 25 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad84a7b3..8c610339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and - {pull}`703` fixes {issue}`701` by allowing `--capture tee-sys` again. - {pull}`704` adds the `--explain` flag to show why tasks would be executed. Closes {issue}`466`. +- {pull}`706` disables syntax highlighting for platform version information in session header. ## 0.5.5 - 2025-07-25 diff --git a/docs/source/_static/md/capture.md b/docs/source/_static/md/capture.md index 0f41a9de..afc7e525 100644 --- a/docs/source/_static/md/capture.md +++ b/docs/source/_static/md/capture.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 2 tasks. diff --git a/docs/source/_static/md/clean-dry-run-directories.md b/docs/source/_static/md/clean-dry-run-directories.md index 0451985f..063e8925 100644 --- a/docs/source/_static/md/clean-dry-run-directories.md +++ b/docs/source/_static/md/clean-dry-run-directories.md @@ -4,7 +4,7 @@ $ pytask clean --directories ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/clean-dry-run.md b/docs/source/_static/md/clean-dry-run.md index e5b094be..4872c9e3 100644 --- a/docs/source/_static/md/clean-dry-run.md +++ b/docs/source/_static/md/clean-dry-run.md @@ -4,7 +4,7 @@ $ pytask clean ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/collect-nodes.md b/docs/source/_static/md/collect-nodes.md index fac4a7cd..5ba213ff 100644 --- a/docs/source/_static/md/collect-nodes.md +++ b/docs/source/_static/md/collect-nodes.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/collect.md b/docs/source/_static/md/collect.md index 5afdddf6..b7a2adb3 100644 --- a/docs/source/_static/md/collect.md +++ b/docs/source/_static/md/collect.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/defining-dependencies-products.md b/docs/source/_static/md/defining-dependencies-products.md index 161821e6..d991931c 100644 --- a/docs/source/_static/md/defining-dependencies-products.md +++ b/docs/source/_static/md/defining-dependencies-products.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 2 task. diff --git a/docs/source/_static/md/dry-run.md b/docs/source/_static/md/dry-run.md index 07c10b41..2a0209ed 100644 --- a/docs/source/_static/md/dry-run.md +++ b/docs/source/_static/md/dry-run.md @@ -4,7 +4,7 @@ $ pytask --dry-run ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/explain.md b/docs/source/_static/md/explain.md index f90fa425..0f7e8a54 100644 --- a/docs/source/_static/md/explain.md +++ b/docs/source/_static/md/explain.md @@ -4,7 +4,7 @@ $ pytask --explain ────────────────────────── Start pytask session ───────────────────────── -Platform: darwin -- Python 3.12.0, pytask 0.5.6, pluggy 1.6.0 +Platform: darwin -- Python 3.12.0, pytask 0.5.6, pluggy 1.6.0 Root: /Users/pytask-dev/git/my_project Collected 3 tasks. diff --git a/docs/source/_static/md/migrating-from-scripts-to-pytask.md b/docs/source/_static/md/migrating-from-scripts-to-pytask.md index 4f498035..4508d10a 100644 --- a/docs/source/_static/md/migrating-from-scripts-to-pytask.md +++ b/docs/source/_static/md/migrating-from-scripts-to-pytask.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/pdb.md b/docs/source/_static/md/pdb.md index 2131d5fb..c510ce7b 100644 --- a/docs/source/_static/md/pdb.md +++ b/docs/source/_static/md/pdb.md @@ -4,7 +4,7 @@ $ pytask --pdb ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/persist-executed.md b/docs/source/_static/md/persist-executed.md index 6a2f0b86..f2d8ba0d 100644 --- a/docs/source/_static/md/persist-executed.md +++ b/docs/source/_static/md/persist-executed.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/persist-persisted.md b/docs/source/_static/md/persist-persisted.md index 5db81309..75f055ed 100644 --- a/docs/source/_static/md/persist-persisted.md +++ b/docs/source/_static/md/persist-persisted.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/persist-skipped.md b/docs/source/_static/md/persist-skipped.md index 8c563282..27cfbcab 100644 --- a/docs/source/_static/md/persist-skipped.md +++ b/docs/source/_static/md/persist-skipped.md @@ -4,7 +4,7 @@ $ pytask --verbose 2 ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/profiling-tasks.md b/docs/source/_static/md/profiling-tasks.md index f1212373..e906ecc5 100644 --- a/docs/source/_static/md/profiling-tasks.md +++ b/docs/source/_static/md/profiling-tasks.md @@ -4,7 +4,7 @@ $ pytask profile ───────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 18 task. diff --git a/docs/source/_static/md/readme.md b/docs/source/_static/md/readme.md index 7bfcd368..e0a2e096 100644 --- a/docs/source/_static/md/readme.md +++ b/docs/source/_static/md/readme.md @@ -4,7 +4,7 @@ $ pytask ──────────────────────────── Start pytask session ──────────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/repeating-tasks.md b/docs/source/_static/md/repeating-tasks.md index d4e357b9..4f461bc4 100644 --- a/docs/source/_static/md/repeating-tasks.md +++ b/docs/source/_static/md/repeating-tasks.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 10 task. diff --git a/docs/source/_static/md/show-locals.md b/docs/source/_static/md/show-locals.md index 8352cb78..8152e69c 100644 --- a/docs/source/_static/md/show-locals.md +++ b/docs/source/_static/md/show-locals.md @@ -4,7 +4,7 @@ $ pytask --show-locals ──────────────────────────── Start pytask session ──────────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/trace.md b/docs/source/_static/md/trace.md index 0ab7edc2..fc1dda5b 100644 --- a/docs/source/_static/md/trace.md +++ b/docs/source/_static/md/trace.md @@ -4,7 +4,7 @@ $ pytask --trace ──────────────────────────── Start pytask session ──────────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/try-first.md b/docs/source/_static/md/try-first.md index bc71ba4b..3363b6b6 100644 --- a/docs/source/_static/md/try-first.md +++ b/docs/source/_static/md/try-first.md @@ -4,7 +4,7 @@ $ pytask -s ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 2 task. diff --git a/docs/source/_static/md/try-last.md b/docs/source/_static/md/try-last.md index 2abbe272..7e1e128b 100644 --- a/docs/source/_static/md/try-last.md +++ b/docs/source/_static/md/try-last.md @@ -4,7 +4,7 @@ $ pytask -s ────────────────────────── Start pytask session ──────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 2 task. diff --git a/docs/source/_static/md/warning.md b/docs/source/_static/md/warning.md index 558af1ba..2295f900 100644 --- a/docs/source/_static/md/warning.md +++ b/docs/source/_static/md/warning.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/docs/source/_static/md/write-a-task.md b/docs/source/_static/md/write-a-task.md index 9f12c4eb..a8fe9f8f 100644 --- a/docs/source/_static/md/write-a-task.md +++ b/docs/source/_static/md/write-a-task.md @@ -4,7 +4,7 @@ $ pytask ────────────────────────── Start pytask session ───────────────────────── -Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 +Platform: win32 -- Python 3.12.0, pytask 0.5.3, pluggy 1.3.0 Root: C:\Users\pytask-dev\git\my_project Collected 1 task. diff --git a/src/_pytask/logging.py b/src/_pytask/logging.py index 62ab564f..ce4bd6cb 100644 --- a/src/_pytask/logging.py +++ b/src/_pytask/logging.py @@ -66,7 +66,8 @@ def pytask_log_session_header(session: Session) -> None: console.rule("Start pytask session", style="default") console.print( f"Platform: {sys.platform} -- Python {platform.python_version()}, " - f"pytask {_pytask.__version__}, pluggy {pluggy.__version__}" + f"pytask {_pytask.__version__}, pluggy {pluggy.__version__}", + highlight=False, ) console.print(f"Root: {session.config['root']}") if session.config["config"] is not None: