boakley/robotframework-hub

How to add libraries from Python path to rfhub

aaltat opened this issue · 4 comments

it is not configurable from command line, how I select libraries from PYTHON_HOME/Lib/site-packages folder.

Example I did install: robotframework-archivelibrary and it is located in: PYTHON_HOME/Lib/site-packages/ArchiveLibrary folder. Then I did start rfhub with commands:
python -m rfhub C:\Python27\Lib\site-packages\ArchiveLibrary__init__.py
python -m rfhub C:\Python27\Lib\site-packages\ArchiveLibrary
python -m rfhub C:\Python27\Lib\site-packages\ArchiveLibrary

But none of those command add the ArchiveLibrary to the documentation.

It would be nice if there would be command line flag or even a configuration file which libraries are read from PYTHON_HOME/Lib/site-packages folder. As a workaround I did change kwdb.py, line 209 from:

    def add_installed_libraries(self, extra_libs = ["Selenium2Library",
                                                    "SudsLibrary",
                                                    "RequestsLibrary"]):

to:

    def add_installed_libraries(self, extra_libs = ["Selenium2Library",
                                                    "SudsLibrary",
                                                    "RequestsLibrary",
                                                    "ArchiveLibrary"]):

@boakley, how do feel about adding a command line argument to handle this?. It is impossible to do any kind of automatic discovery and loading of libraries without first parsing all test case and resource files for library imports.

In the longer run, I think the hub should support a configuration file also.

I've been thinking about a --library option to add a library (which you
could use multiple times), and perhaps supporting argument files like robot
does.

For example, you could do "python -m rfhub --library Selenium2Library
--library RequestsLibrary

Using an argument file you might do something like this:

python -m rfhub --argumentfile rfhub-libraries.args

rfhub-libraries.args would then have something like:

# foo.args
--library Selenium2Library
--library RequestsLibrary

What do you think?

On Tue, Sep 2, 2014 at 10:41 AM, Janne Härkönen notifications@github.com
wrote:

@boakley https://github.com/boakley, how do feel about adding a command
line argument to handle this?. It is impossible to do any kind of automatic
discovery and loading of libraries without first parsing all test case and
resource files for library imports.

In the longer run, I think the hub should support a configuration file
also.


Reply to this email directly or view it on GitHub
#36 (comment)
.

From my point of view both options are good. If I would have to choose, I would take command line options.

changeset c2b9262 fixes this