8000 Add file to get basic setup information for debugging. · sna19/html5lib-python@459ba5f · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 459ba5f

Browse files
committed
Add file to get basic setup information for debugging.
And run this after tests on Travis to show what environment we're in.
1 parent b2ac32a commit 459ba5f

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ install:
1313
- pip install -r requirements.txt -r requirements-test.txt --use-mirrors
1414

1515
script:
16-
- nosetests
16+
- nosetests
17+
18+
after_script:
19+
- python debug-info.py

debug-info.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from __future__ import print_function, unicode_literals
2+
3+
import platform
4+
import sys
5+
6+
7+
info = {
8+
"impl": platform.python_implementation(),
9+
"version": platform.python_version(),
10+
"revision": platform.python_revision(),
11+
"maxunicode": sys.maxunicode,
12+
"maxsize": sys.maxsize
13+
}
14+
15+
search_modules = ["chardet", "datrie", "genshi", "html5lib", "lxml", "six"]
16+
found_modules = []
17+
18+
for m in search_modules:
19+
try:
20+
__import__(m)
21+
except ImportError:
22+
pass
23+
else:
24+
found_modules.append(m)
25+
26+
info["modules"] = ", ".join(found_modules)
27+
28+
29+
print("""html5lib debug info:
30+
31+
Python %(version)s (revision: %(revision)s)
32+
Implementation: %(impl)s
33+
34+
sys.maxunicode: %(maxunicode)X
35+
sys.maxsize: %(maxsize)X
36+
37+
Installed modules: %(modules)s""" % info)

0 commit comments

Comments
 (0)
0