[Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 19 17:46:57 PDT 2015

zturner added a comment.

Todd, do you have any good ideas on how to organize this and make it play nicely with python's module / package system?  `dotest` is just an arbitrary script under lldb/test and is not part of any installed package or anything.  At the same time, third party code needs to be in a centralized place at the top-level in case it needs to be tracked or audited by legal people.  So I don't think we can put six under `test` (nor would it even make sense to, since that wouldn't help people under lldb/scripts who also want to use it).

So somehow `lldb/scripts` and `lldb/test` both need to be able to import from `lldb/third_party/Python/modules`.

I know this isn't really the "pythonic" way, because it expects everything to be nicely organized packages with a nice hierarchy, but dotest is treated as a one-off script.  I don't really want people to have to install `six` via setuptools or anything because it just adds an unnecessary extra step which is a regression from the status quo.

Do absolute imports help us?  (https://docs.python.org/2.5/whatsnew/pep-328.html)

I think this question speaks to a more general problem of: "How do we re-use python code across tests and scripts?"  Do you have any suggestions that can make this work cleanly?


More information about the lldb-commits mailing list