diff --git a/CHANGES.md b/CHANGES.md index 30c00566b3c..3bf481fb580 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -37,6 +37,8 @@ +- Output python version and implementation as part of `--version` flag (#2997) + ### Packaging diff --git a/src/black/__init__.py b/src/black/__init__.py index bdeb73273bc..3a2d1cb8898 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -10,6 +10,7 @@ import os from pathlib import Path from pathspec.patterns.gitwildmatch import GitWildMatchPatternError +import platform import re import signal import sys @@ -381,7 +382,10 @@ def validate_regex( ) @click.version_option( version=__version__, - message=f"%(prog)s, %(version)s (compiled: {'yes' if COMPILED else 'no'})", + message=( + f"%(prog)s, %(version)s (compiled: {'yes' if COMPILED else 'no'})\n" + f"Python ({platform.python_implementation()}) {platform.python_version()}" + ), ) @click.argument( "src",