format-webkitpy: No module named pep8 |
|||||
Issue description
When I run format-webkitpy on Ubuntu, I get the following:
$ third_party/WebKit/Tools/Scripts/format-webkitpy
Traceback (most recent call last):
File "third_party/WebKit/Tools/Scripts/format-webkitpy", line 8, in <module>
from webkitpy.formatter.main import main
File "/b/c/src/third_party/WebKit/Tools/Scripts/webkitpy/formatter/main.py", line 9, in <module>
from webkitpy.thirdparty import autopep8
File "/b/c/src/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py", line 59, in <module>
import pep8
ImportError: No module named pep8
I attempted to install pep8 as follows, and it seemed to succeed:
$ sudo pip install pep8
[sudo] password for skobes:
Downloading/unpacking pep8
Downloading pep8-1.7.0-py2.py3-none-any.whl (41kB): 41kB downloaded
Installing collected packages: pep8
Successfully installed pep8
Cleaning up...
However, I still get the same error from format-webkitpy.
,
Aug 28 2017
https://chromium-review.googlesource.com/c/chromium/src/+/638693
,
Aug 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ef32c4ae540cb5cf1be5117f9a800389cfa4864d commit ef32c4ae540cb5cf1be5117f9a800389cfa4864d Author: Quinten Yearsley <qyearsley@google.com> Date: Mon Aug 28 22:46:19 2017 In formatter/main.py change sys.path so that pep8 can be found Bug: 759231 Change-Id: I93ec80617bd361d444c5bd6a05e3a497666c6cce Reviewed-on: https://chromium-review.googlesource.com/638693 Commit-Queue: Quinten Yearsley <qyearsley@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/master@{#497914} [modify] https://crrev.com/ef32c4ae540cb5cf1be5117f9a800389cfa4864d/third_party/WebKit/Tools/Scripts/webkitpy/common/path_finder.py [modify] https://crrev.com/ef32c4ae540cb5cf1be5117f9a800389cfa4864d/third_party/WebKit/Tools/Scripts/webkitpy/formatter/main.py
,
Aug 28 2017
,
Aug 28 2017
Thanks for the quick fix!
,
Aug 28 2017
I'm a bit confused... if this is using vpython, why didn't we add pep8 to the vpython spec? Changing sys.path leads to the dark side of the force (most of the time :)).
,
Aug 28 2017
:-) That's true. My excuse/rationale here was that pep8 is used only for this script, so it doesn't quite seem right to put it in Tools/Scripts/common.vpython -- and pep8.py is already in webkitpy/thirdparty/. Do you still think it's better to use vpython to get it? I could put a venv config inside of a comment in Tools/Scripts/format-webkitpy, right?
,
Aug 28 2017
Ideally we'd have a common set of packages that we added and used chromium-wide and then we'd get rid of the individually hand-managed packages that have been checked in (like the ones in webkitpy/thirdparty).
,
Aug 29 2017
Right, that's true. I'll close this bug for now; tweaking the code to use the copy of pep8 in webkitpy/thirdparty was just keeping the status quo; it's worth noting that in general in the future we can decrease the number of checked-in dependencies. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by qyears...@chromium.org
, Aug 28 2017