Open Bug 1191373 Opened 4 years ago Updated 4 years ago

[mozrunner] should we make mozdevice an optional dependency of mozrunner ?

Categories

(Testing :: Mozbase, defect)

defect
Not set

Tracking

(firefox42 affected)

Tracking Status
firefox42 --- affected

People

(Reporter: parkouss, Unassigned)

References

(Blocks 1 open bug)

Details

It appears that in some cases (eg firefox-ui-tests, marionette for desktop) mozdevice is not required. Still it is a hard dependency of mozrunner, so it is installed anyway.

We could:
 1) make mozdevice an optional dependency of mozrunner (e.g., requiring "mozrunner[device]" to get mozrunner with mozdevice)
 2) make mozrunner[device] an optional dependency of marionette (maybe name it marionette[device] ?)

We need to be sure that point 2 can be achieved I thin it is possible with something like:

# setup.py of marionette client
setup(
    install_requires=['mozrunner'],
    extras_require={'device': ['mozrunner[device]']},
)

but this has to be tested to be sure.

See https://pythonhosted.org/setuptools/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies for reference.
If the above works, I kinda like that proposal. If we do it keep in mind that consumers of mozdevice will have to be notified. It's a breaking change.
Unfortunately this does not work (I tried with latest pypi).

When the dependency is in install_requires and extras_require, the extra is not applied even when it contains sub-extra - this ends up with "pip install marionette[device]" not installing mozrunner[device] but mozrunner only.

I also tried this syntax:

setup(
    install_requires=[],
    extras_require={
        '': ['mozrunner'],
        'device': ['mozrunner[device]']},
)

But not working either. this time the "pip install mozregression" does not require mozrunner at all, but "pip install marionette[device]" works.

This may be a pip bug, I am thinking about reporting it.


But anyway I suspect it won't be applicable here for us, as even if this get fixed into pip this would mean force a minimal pip version for users. Another option may be to write some (probably ugly) patch in the setup.py of marionette to make this works - or just close this bug as WONTFIX if you don't think it worth the cost.
You need to log in before you can comment on or make changes to this bug.