[Webkit-unassigned] [Bug 183796] Lint web-platform-tests changes with the wpt linter before exporting
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 21 09:44:14 PDT 2018
https://bugs.webkit.org/show_bug.cgi?id=183796
--- Comment #6 from Jonathan Bedard <jbedard at apple.com> ---
Comment on attachment 336193
--> https://bugs.webkit.org/attachment.cgi?id=336193
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=336193&action=review
>> Tools/Scripts/webkitpy/w3c/test_exporter.py:46
>> +sys.path.append(WEBKIT_WPT_DIR)
>
> I wonder whether we have another way of doing this. Jonathan, Dean?
> Maybe this explains why webkitpy bot is failing here.
>
> Brendan, you can try to do what the bot is doing to reproduce the issue:
> /Volumes/.. /Tools/Scripts/webkit-patch build-and-test --no-clean --no-update --test --non-interactive --build-style=release --group=webkitpy --port=mac
Unless the containing script added this directory the python path, sys.path.append is probably the best way to do this. There are some other nasty import magic stuff you can do, but I think that makes things more difficult.
I believe this comment should read 'Add web-platform-tests to the python path so we can import the WPT lint module'
You also want to do something like this to handle people running from weird directories:
WEBKIT_WPT_DIR = os.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '..', 'LayoutTests', 'imported', 'w3c', 'web-platform-tests'')
...
sys.path.append(WEBKIT_WPT_DIR)
I would also prefer that we append 'LayoutTests/imported/w3c' and future imports would be 'from <something WPT unique>.tools.lint.lint import ....' The trouble with this is that 'web-platform-tests' is an invalid module name in Python.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180321/fda0b6b4/attachment-0001.html>
More information about the webkit-unassigned
mailing list