[gui] python 'gui/build.py run' fails on mac

RESOLVED FIXED

Status

Testing
mozregression
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: MikeLing, Assigned: MikeLing)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

49 bytes, text/x-github-pull-request
parkouss
: review+
Details | Review | Splinter Review
(Assignee)

Description

3 years ago
When I want to run build.py on the OS X platform. It will tells me:

> (mozr)MikeLings-MacBook-Pro:mozregression mikeling$ python gui/build.py run
> Executing `/Users/mikeling/mozregression/mozr/bin/python mozregui/main.py`
> Traceback (most recent call last):
>   File "mozregui/main.py", line 7, in <module>
>     from PyQt4.QtGui import QApplication, QMainWindow, QMessageBox
> ImportError: No module named PyQt4.QtGui
> ERROR: Command '('/Users/mikeling/mozregression/mozr/bin/python', 'mozregui/main.py')' returned non-zero exit status 1
>

So, after discuss with :parkouss on irc, we found it's because mac uses PYTHONPATH to find the packages the mozregression need. But in the build.py, we just override it(https://github.com/mozilla/mozregression/blob/master/gui/build.py#L63). Therefore, we need to update the PYTHONPATH variable with '.' in build.py, and not override it.

Due to I haven't meet this problem when running under the Ubuntu 12.04 and Windows7, I can't tell if it's a universally problem. So, I decide to treat it as a specially problem on Mac platform for now :).
(Assignee)

Updated

3 years ago
Assignee: nobody → sabergeass
(Assignee)

Comment 1

3 years ago
Created attachment 8638554 [details] [review]
PR for bug 1187302
Attachment #8638554 - Flags: review?(j.parkouss)
Comment on attachment 8638554 [details] [review]
PR for bug 1187302

Thanks for this!

Well the test with env["PYTHONPATH"] could leave to a KeyError (in case the env var is not defined) so it should be fixed.

I also noted some minor comments on the PR.
Attachment #8638554 - Flags: review?(j.parkouss) → review+
Yup, thanks for the update - just one last thing to change (this is failing when PYTHONPATH is not defined for me), and after that I'll be happy to merge this in. :)
All good now, thanks!

Merged in https://github.com/mozilla/mozregression/commit/eff6817cc35f76cb46fc7810a9e714eed439275d.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.