deps: allow for relative package imports in dependency checks

deps.py would previously run chdir into the Python file which
it is checking before trying to import it.  This caused failures
on modules with relative imports, since they must be imported
under a package namespace.

Modify deps.py to instead chdir into the file's parent directory,
so that it will be able to import properly in this case.

BUG=chromium:618961
TEST=Locally

Change-Id: I09a2899f3bc61949a4ba6d49e854f27e265b0428
Reviewed-on: https://chromium-review.googlesource.com/351420
Commit-Ready: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
1 file changed