Re: [chromium-dev] Advice requested - where should I put my python script?

8 views
Skip to first unread message

Dirk Pranke

unread,
Jan 15, 2021, 6:08:21 PM1/15/21
to Daniel Murphy, Dana Jansens, Chromium-dev, python
+python ...

I would generally try to keep your python code near your C++ code, either in the same directory or in a subdirectory like .../util/... or .../test/... as makes the most sense.

I don't think we have any particular guidelines on how to do this. In some ideal world it might be nice if all of the python code lived in its own directory hierarchy so we wouldn't have to do any sys.path-hacking tricks in order to import libraries, but then your python code would be separated from the other code for your project. 

I believe in python3+ we'll no longer need empty __init__.py files and then it might be more viable to do something like 'from chrome.browser.policy.util import whatever', though.

-- Dirk

On Fri, Jan 15, 2021 at 2:12 PM 'Daniel Murphy' via Chromium-dev <chromi...@chromium.org> wrote:
Interesting... modifying your search I see a bunch of python files in chrome/test .. maybe not a bad place either?

On Fri, Jan 15, 2021 at 2:05 PM <dan...@chromium.org> wrote:

On Fri, Jan 15, 2021 at 5:01 PM 'Daniel Murphy' via Chromium-dev <chromi...@chromium.org> wrote:
Hello!

I'm building a testing framework that involves using a python script. This python script will NOT be executed on the waterfall, only as a tool for generating test sets by developers adding new tests. My question is - where should I put this?

The code / framework is in the browser (chrome/browser area). I could just put it in the same directory as our main directory for the system (full of c++ files). Maybe sub directory?

Follow-up question - where should I put tests / how should I write tests? I was thinking I would roll my own little testing code to keep python external dependencies at 0, and then just run them every time the script is run (again, only off-bots by devs adding tests) - but not sure what the norm is here. Do we have documentation about maintaining python stuff? 

Any guidance is appreciated :)

Thanks!
Daniel

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CA%2B4qT32kOvkN%2BSNoVV3O_10hhUE93rCkwsavvrcFS3Cg8mkOzg%40mail.gmail.com.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CA%2B4qT33w1xv3SzuD0k2YQtu%2BDoRy-P8pE0gPOnu6%2BDicv5A%3Drw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages