Skip to content

Commit bd79f6f

Browse files
authored
Merge pull request #1798 from nicolassanchez02/feature/version-verbosity
openage --version: add Platform block
2 parents 6d104ab + 0f2f411 commit bd79f6f

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

openage/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2013-2023 the openage authors. See copying.md for legal info.
1+
# Copyright 2013-2026 the openage authors. See copying.md for legal info.
22

33
"""
44
The Python part of openage, a free engine re-write of
@@ -41,9 +41,7 @@
4141
f"Mako {config.MAKOVERSION}\n"
4242
f"NumPy {config.NUMPYVERSION}\n"
4343
f"Pillow {config.PILVERSION}\n"
44-
f"Pygments {config.PYGMENTSVERSION}\n"
45-
"\n"
46-
"== C++ =="
44+
f"Pygments {config.PYGMENTSVERSION}"
4745
)
4846

4947

openage/__main__.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2015-2024 the openage authors. See copying.md for legal info.
1+
# Copyright 2015-2026 the openage authors. See copying.md for legal info.
22
#
33
# pylint: disable=too-many-statements
44
"""
@@ -22,12 +22,33 @@ def print_version():
2222
The default version printer, unfortunately, inserts newlines.
2323
This is the easiest way around.
2424
"""
25+
import platform
26+
2527
from . import LONGVERSION
2628
print(LONGVERSION)
27-
from .versions.versions import get_version_numbers
28-
version_numbers = get_version_numbers()
29-
for key in version_numbers:
30-
print(key.decode("utf8") + " " + version_numbers[key].decode("utf8"))
29+
30+
print()
31+
print("== Platform ==")
32+
print(f"System {platform.system()} {platform.release()}")
33+
print(f"Version {platform.version()}")
34+
print(f"Architecture {platform.machine()}")
35+
print(f"Python impl {platform.python_implementation()} {platform.python_version()}")
36+
print(f"Executable {sys.executable}")
37+
print(f"openage path {os.path.dirname(os.path.realpath(__file__))}")
38+
libc_lib, libc_ver = platform.libc_ver()
39+
if libc_lib:
40+
print(f"libc (probe) {libc_lib} {libc_ver}")
41+
42+
print()
43+
print("== C++ ==")
44+
try:
45+
from .versions.versions import get_version_numbers
46+
except ImportError:
47+
print("(unavailable; openage.versions Cython module not built)")
48+
else:
49+
version_numbers = get_version_numbers()
50+
for key in version_numbers:
51+
print(key.decode("utf8") + " " + version_numbers[key].decode("utf8"))
3152
sys.exit(0)
3253

3354

0 commit comments

Comments
 (0)