PyDev tasks tags for files not in PYTHONPATHAsk Question

问题:

For work I have decent number of automation scripts organised in directories. Since these scripts are not modules which can be imported by other scripts there is no need for them to be in PYTHONPATH. And because they are not in PYTHONPATH i cannot use tasks tags in those files.

I can think of two ways to solve this problem.

  1. Add all those directories in PYTHONPATH. As there can be lots of directories this is not an ideal solution.
  2. Add root directory to PYTHONPATH and add init.py in each directory. Now all those stand alone directories/scripts are considered as packages/modules which is not right.
  3. Throw all automation scripts in just one or two folders and add that to PYTHONPATH.

Has anyone figured out a better way to handle this?

回答1:


Usually I just go with #3 -- although even more recently I'm having a tasks.py and using http://www.pyinvoke.org to organize things better ;)

Otherwise, PyDev could change how it builds to consider TODO tasks in any files, not only those in the PYTHONPATH... you may report that to https://www.brainwy.com/tracker/PyDev if you feel this would be the best approach (although it's probably not a high-priority given other requests, so, even better would be providing a pull request for that -- see http://www.pydev.org/developers.html for details on that).

标签: eclipse pydev
© 2014 TuiCode, Inc.