Add an informative __main__.py#620
Conversation
Give users an easy way to figure out what versions they're running.
Codecov Report
@@ Coverage Diff @@
## master #620 +/- ##
==========================================
+ Coverage 96.78% 96.79% +<.01%
==========================================
Files 16 18 +2
Lines 5628 5642 +14
Branches 392 393 +1
==========================================
+ Hits 5447 5461 +14
Misses 121 121
Partials 60 60
Continue to review full report at Codecov.
|
|
FTR, on my computer the output looks like this: That should be helpful when pinning down packaging problems. Opinions? |
alexwlchan
left a comment
There was a problem hiding this comment.
Worth a note in CONTRIBUTING.rst suggesting that users include the output in their bug report?
|
I would even add a bug template…BUT: not before it’s released? |
|
|
| if __name__ != "__main__": | ||
| raise ImportError("This module can't be imported.") | ||
|
|
||
| wot = """\ |
There was a problem hiding this comment.
I don't know what "wot" means, please use a real variable name.
|
|
||
|
|
||
| if __name__ != "__main__": | ||
| raise ImportError("This module can't be imported.") |
There was a problem hiding this comment.
This code should go in a main function which is invoked in the __main__ block, that way it can be tested in memory
| wot = """\ | ||
| pyOpenSSL: {pyopenssl} | ||
| cryptography: {cryptography} | ||
| OpenSSL: {openssl} |
There was a problem hiding this comment.
You may want to distinguish between the linked version of OpenSSL and the compiled-against version.
|
I wasn’t quite sure what you meant with linked/compiled? I’ve added the OpenSSL the Python ist compiled against, since that is occasionally useful too: |
|
I’ve add the cffi version which is (not only) interesting for #622. |
| @@ -0,0 +1,36 @@ | |||
| from __future__ import print_function | |||
There was a problem hiding this comment.
This doesn't need to be a package, just debug.py is sufficient.
|
When @alex said linked vs compiled he meant that when cryptography is compiled the OpenSSL headers are used to determine version. You can obtain the version that was seen during the compile phase with |
Give users an easy way to figure out what versions they're running.
These questions come up with every bug.