Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 840 by [email protected]: libdoc.py: is an actual import of
dependencies really required?
http://code.google.com/p/robotframework/issues/detail?id=840
Is it really required for libdoc.py to actualy import dependencies of the
Robot Python library to be documeneted? Currently it can't handle a module
if it imports modules not in PYTHONPATH - example:
$ ls src/OracleLibrary/OracleLibrary/
__init__.py
$ grep 'import cx_Oracle' src/OracleLibrary/OracleLibrary/__init__.py
import cx_Oracle
$ python libdoc.py src/OracleLibrary/OracleLibrary
Importing test library 'OracleLibrary' failed: ImportError: No module named
cx_Oracle
(...snip...)
Traceback (most recent call last):
File "/home/misio/instal/robotframework-2.5.7/src/robot/utils/importing.py",
line 88, in _import
imported = __import__(modname, {}, {}, fromlist)
File "/home/misio/ROBOT/DBLibs/src/OracleLibrary/OracleLibrary/__init__.py",
line 2, in <module>
import cx_Oracle
But, the funny thing is that it's enough to create a dummy, empty "module",
for the above error to perish:
$ touch src/OracleLibrary/OracleLibrary/cx_Oracle.py
$ ls -l src/OracleLibrary/OracleLibrary/cx_Oracle.py
-rw-r--r-- 1 misio misio 0 May 10 14:11
src/OracleLibrary/OracleLibrary/cx_Oracle.py
$ python libdoc.py src/OracleLibrary/OracleLibrary
OracleLibrary -> /home/misio/ROBOT/DBLibs/OracleLibrary.html
The html looks OK. Could such a mechanism be incorporated into libdoc? This
would greatly ease automated Robot libdocs generation - currently one needs
to install the "missing" modules, possibly play with PYTHONPATH, or resort
to "dummy module" hacks like shown above. Ugly and very uncovenient in
continous integration.