[New-bugs-announce] [issue30871] Add a "python info" command somewhere to dump versions of all dependencies

STINNER Victor report at bugs.python.org
Fri Jul 7 10:48:35 EDT 2017


New submission from STINNER Victor:

While discussing how to dump the readline version in regrtest or test_readline in bpo-29854, I proposed to add a new buildbot step to dump any kinds of debug information. It would avoid to pollute test output with useless information. For example, while the hash implementation is useful for unit tests on the hash function, I dislike always dumping it in the regrtest header.

The idea would be to get a phpinfo-like report:
http://php.net/phpinfo

We can start with an hardcoded list using "try: import xxx except ImportError: pass else: ...", but later we may it more "pluggable" somehow?

Maybe define a protocol (function with a specific name, maybe a private function?) for each module, add a command which can dump info on a single module, or all modules.

Maybe start with an hardcoded list of modules, but later discover automatically all stdlib modules?

I don't expect a regular list of information, but more like a long key-value list.

Attached pythoninfo.py is an example of such script. It works on Python 2.7-3.7. Example of Python 3.7 output on my Linux PC:
---
cpu_count: 4
cwd: /home/haypo/prog/GIT/misc/python
filesystem_encoding: utf-8
filesystem_errors: surrogateescape
gdb_version: GNU gdb (GDB) Fedora 7.12.1-48.fc25
hash algorithm: ('siphash24', '64bit')
locale_encoding: UTF-8
platform: Linux-4.11.6-201.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five
python_implementation: CPython
readline_library_version: 6.3
readline_runtime_version: 0x603
readline_version: 0x603
sys.byteorder: little
sys.flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
sys.maxsize: 9223372036854775807
sys.version: 3.7.0a0 (heads/testcapi_stack_pointer_master:81dd3fb, Jul  6 2017, 13:10:36)  [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]
tcl_version: 8.6
---

Later, we may add a JSON output format, to allow to collect informations of all buildbots. For example, check all tested readline versions.

----------
components: Tests
files: pythoninfo.py
messages: 297885
nosy: haypo
priority: normal
severity: normal
status: open
title: Add a "python info" command somewhere to dump versions of all dependencies
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46994/pythoninfo.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30871>
_______________________________________


More information about the New-bugs-announce mailing list