]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Output python version and implementation as part of `--version` flag (#2997)
authorJoe Young <80432516+jpy-git@users.noreply.github.com>
Wed, 6 Apr 2022 18:04:12 +0000 (19:04 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Apr 2022 18:04:12 +0000 (14:04 -0400)
Example:

black, 22.1.1.dev56+g421383d.d20220405 (compiled: no)
Python (CPython) 3.9.12

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
CHANGES.md
src/black/__init__.py

index 30c00566b3cd627146a35abd6f48566337f2e1cc..3bf481fb580cfd77b42aa20045042a32b09346be 100644 (file)
@@ -37,6 +37,8 @@
 
 <!-- Changes to Black's terminal output and error messages -->
 
+- Output python version and implementation as part of `--version` flag (#2997)
+
 ### Packaging
 
 <!-- Changes to how Black is packaged, such as dependency requirements -->
index bdeb73273bc96ca56d967629ea57e5d6dd802da9..3a2d1cb88981f12936c09b0dfbdfc561c61cfa06 100644 (file)
@@ -10,6 +10,7 @@ from multiprocessing import Manager, freeze_support
 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",