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

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Nick Coghlan: "If we end up deciding some of this information might be useful 
to end users as well, it would be reasonable to extend "python -m sysconfig" to 
report it, perhaps with the extra imports gated behind a command line option."

Designing such tool is a can of worm. Everybody can have different expectation, 
different information. IMHO PyPI is a better home for a more general tool. I 
prefer to keep test.pythoninfo specialized to debug failures on CIs (Travis CI, 
AppVeyor, buildbots).

For test.pythoninfo, I'm mostly interested to get plaintext output right now, 
and JSON output later, to correlate information. For example, be able to say 
which readline versions are tested on all buildbots for one Python branch.

Moreover, I would like to add test.pythoninfo to Python 2.7 and 3.6. It 
wouldn't be doable if the tool would be in the stdlib, since these branches 
don't accept new features ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-18 Thread Nick Coghlan

Nick Coghlan added the comment:

If we end up deciding some of this information might be useful to end users as 
well, it would be reasonable to extend "python -m sysconfig" to report it, 
perhaps with the extra imports gated behind a command line option.

--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ad7eaed54382b346784e51a6f0122ce81e8842b5 by Victor Stinner in 
branch 'master':
bpo-30871: pythoninfo: more sys, os, time data (#3130)
https://github.com/python/cpython/commit/ad7eaed54382b346784e51a6f0122ce81e8842b5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3164

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset a3a01a2fceab2188b282ab9911f79c99a4c32273 by Victor Stinner in 
branch 'master':
bpo-30871: Add "make pythoninfo" (#3120)
https://github.com/python/cpython/commit/a3a01a2fceab2188b282ab9911f79c99a4c32273


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

STINNER Victor added the comment:


New changeset f6ebd838f00b4c211c72d85ee49749e910cd3afe by Victor Stinner in 
branch 'master':
bpo-30871: pythoninfo: add expat and _decimal (#3121)
https://github.com/python/cpython/commit/f6ebd838f00b4c211c72d85ee49749e910cd3afe


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

python -m test.pythoninfo crashes for me on Win10, debug32, but I don't think 
it is the fault of pythoninfo.  See #31288.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3160

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> I plan to backport Lib/test/pythoninfo.py and "make pythoninfo" to Python 2.7 
> and 3.6 to ease debug on all supported Python branches.

Oh, but I will first only run pythoninfo on buildbot for the master branch, 
since I expect surprises depending on the platform :-) Once everything is fine, 
I will backport the enhancement to other branches.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I created https://github.com/python/cpython/pull/3120 to add "make pythoninfo" 
because it's more tricky than what I expected to run "./python -m 
test.pythoninfo" on buildbots. Depending if Python is built with shared 
library, depending on the OS (./python, or ./python.exe for macOS?), ... the 
command is different.

I plan to backport Lib/test/pythoninfo.py and "make pythoninfo" to Python 2.7 
and 3.6 to ease debug on all supported Python branches.

--
versions: +Python 2.7, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3158

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b907abc88589f7bea52c5afe172ececc6edcda70 by Victor Stinner in 
branch 'master':
bpo-30871: Add test.pythoninfo (#3075)
https://github.com/python/cpython/commit/b907abc88589f7bea52c5afe172ececc6edcda70


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy: "For example TCL_VERSION and TK_VERSION are static versions (they 
should be equal in modern Tcl/Tk), and Tcl command "info patchlevel" returns 
the dynamic version."

Ok, I added tkinter.patchlevel info which calls "info patchlevel".


Serhiy: "In the readline module _READLINE_VERSION is header version, 
_READLINE_RUNTIME_VERSION and _READLINE_LIBRARY_VERSION are runtime versions."

The 3 variables are stored.


Serhiy: "In the zlib module ZLIB_VERSION is header version, 
ZLIB_RUNTIME_VERSION is runtime version."

I just added the 2 variables.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-16 Thread STINNER Victor

STINNER Victor added the comment:

Berker: "2. Could you also add version information of sqlite3?"

Sure, done.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Sorry, version of what?

Versions of any external library. Python can be built with headers of one 
version, but dynamically load the library of other version.

For example TCL_VERSION and TK_VERSION are static versions (they should be 
equal in modern Tcl/Tk), and Tcl command "info patchlevel" returns the dynamic 
version. In the readline module _READLINE_VERSION is header version, 
_READLINE_RUNTIME_VERSION and _READLINE_LIBRARY_VERSION are runtime versions. 
In the zlib module ZLIB_VERSION is header version, ZLIB_RUNTIME_VERSION is 
runtime version.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-11 Thread Berker Peksag

Berker Peksag added the comment:

Two things:

1. I've just closed  PR 2618 as the scope of this issue is broader than my PR.
2. Could you also add version information of sqlite3?

--
nosy: +berker.peksag
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-11 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +3116

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-11 Thread STINNER Victor

STINNER Victor added the comment:

Nir Soffer: "I like the idea, may be also useful in 
https://github.com/sosreport/sos/blob/master/sos/plugins/python.py;

It's hard to guess which kinds of informations are needed. My use case is to 
debug failing tests on the Python CIs. Other use cases may want other kinds of 
information.

For example, my perf module also a "python3 -m perf collect_metadata" which has 
a similar goal but reads also information about the CPU: CPU configuration, 
model, temperature, etc. I don't think that these information are useful for 
Python tests.


Serhiy Storchaka: "Note that there are two versions: the version with which the 
interpreter is build, and the version of the dynamic library."

Sorry, version of what? The readline module has two versions, my proposed 
test.pythoninfo tool saves both. Depending on the failing test, you need one 
version or the other, or both.

The purpose of pythoninfo is to be able to log a long list of informations, 
without after to care if it is useful or not in general ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-11 Thread STINNER Victor

STINNER Victor added the comment:

I wrote https://github.com/python/cpython/pull/3075 to add "python3 -m 
test.pythoninfo". I chose to add the script into Lib/test/ to notice users that 
it's design for Python internal usage, for Python tests.

I modified scripts running tests on our CI to also run pythoninfo, and then 
also started to cleanup ("simplify") the regrtest header (remove information 
rarely useful).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-08-11 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3112

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-07-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Something like the CLI of modules site, sysconfig and platform?

Note that there are two versions: the version with which the interpreter is 
build, and the version of the dynamic library.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-07-07 Thread Nir Soffer

Nir Soffer added the comment:

I like the idea, may be also useful in 
https://github.com/sosreport/sos/blob/master/sos/plugins/python.py

--
nosy: +Nir Soffer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-07-07 Thread STINNER Victor

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com